public interface Bin
| Modifier and Type | Method and Description |
|---|---|
void |
close()
closes the Bin.
|
long |
length()
returns the length of the Bin (on disc, in memory).
|
int |
read(long position,
byte[] bytes,
int bytesToRead)
reads a given number of bytes into an array of bytes at an
offset position.
|
void |
sync()
flushes the buffer content to the physical storage
media.
|
void |
sync(java.lang.Runnable runnable)
runs the Runnable between two calls to sync();
|
int |
syncRead(long position,
byte[] bytes,
int bytesToRead)
reads a given number of bytes into an array of bytes at an
offset position.
|
void |
write(long position,
byte[] bytes,
int bytesToWrite)
writes a given number of bytes from an array of bytes at
an offset position
|
long length()
int read(long position,
byte[] bytes,
int bytesToRead)
position - the offset position to read atbytes - the byte array to read bytes intobytesToRead - the number of bytes to be readvoid write(long position,
byte[] bytes,
int bytesToWrite)
position - the offset position to write atbytes - the array of bytes to writebytesToWrite - the number of bytes to writevoid sync()
void sync(java.lang.Runnable runnable)
int syncRead(long position,
byte[] bytes,
int bytesToRead)
read(long, byte[], int)
method, the Bin should ensure direct access to the raw storage medium.
No caching should take place.position - the offset position to read atbytes - the byte array to read bytes intobytesToRead - the number of bytes to be readvoid close()