public class OffsetChannel extends Object implements StoreChannel
| Constructor and Description |
|---|
OffsetChannel(StoreChannel delegate,
long offset) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
force(boolean metaData) |
boolean |
isOpen() |
long |
position() |
StoreChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
int |
read(ByteBuffer dst,
long position) |
long |
size() |
StoreChannel |
truncate(long size) |
FileLock |
tryLock()
Attempts to acquire an exclusive lock on this channel's file.
|
int |
write(ByteBuffer src) |
long |
write(ByteBuffer[] srcs) |
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
int |
write(ByteBuffer src,
long position)
NOTE: If you want to write bytes to disk, use #writeAll(), this does not guarantee all bytes will be written,
and you are responsible for handling the return value of this call (which tells you how many bytes were written).
|
void |
writeAll(ByteBuffer src)
Same as #write(), except this method will write the full contents of the buffer in chunks if the OS fails to
write it all at once.
|
void |
writeAll(ByteBuffer src,
long position)
Same as #write(), except this method will write the full contents of the buffer in chunks if the OS fails to
write it all at once.
|
public OffsetChannel(StoreChannel delegate, long offset)
public FileLock tryLock() throws IOException
StoreChanneltryLock in interface StoreChannelIOException - If an I/O error occurs.ClosedChannelException - if the channel is closed.public int write(ByteBuffer src, long position) throws IOException
StoreChannelwrite in interface StoreChannelIOExceptionpublic void writeAll(ByteBuffer src, long position) throws IOException
StoreChannelwriteAll in interface StoreChannelIOExceptionpublic void writeAll(ByteBuffer src) throws IOException
StoreChannelwriteAll in interface StoreChannelIOExceptionpublic int read(ByteBuffer dst, long position) throws IOException
read in interface StoreChannelIOExceptionFileChannel.read(java.nio.ByteBuffer, long)public void force(boolean metaData)
throws IOException
force in interface StoreChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface SeekableByteChannelwrite in interface WritableByteChannelIOExceptionpublic long position()
throws IOException
position in interface SeekableByteChannelIOExceptionpublic StoreChannel position(long newPosition) throws IOException
position in interface SeekableByteChannelposition in interface StoreChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelIOExceptionpublic StoreChannel truncate(long size) throws IOException
truncate in interface SeekableByteChanneltruncate in interface StoreChannelIOExceptionpublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write in interface GatheringByteChannelIOExceptionpublic long write(ByteBuffer[] srcs) throws IOException
write in interface GatheringByteChannelIOExceptionpublic long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read in interface ScatteringByteChannelIOExceptionpublic long read(ByteBuffer[] dsts) throws IOException
read in interface ScatteringByteChannelIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelIOExceptionCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.