public class SynchronizedBin extends BinDecorator
_bin| Constructor and Description |
|---|
SynchronizedBin(Bin bin) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
closes the BinDecorator and the underlying
Bin. |
long |
length()
returns the length of the Bin (on disc, in memory).
|
int |
read(long position,
byte[] buffer,
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();
|
void |
write(long position,
byte[] bytes,
int bytesToWrite)
writes a given number of bytes from an array of bytes at
an offset position
|
syncReadpublic SynchronizedBin(Bin bin)
public void close()
BinDecoratorBin.close in interface Binclose in class BinDecoratorpublic long length()
Binlength in interface Binlength in class BinDecoratorBin.length()public int read(long position,
byte[] buffer,
int bytesToRead)
Binread in interface Binread in class BinDecoratorposition - the offset position to read atbuffer - the byte array to read bytes intobytesToRead - the number of bytes to be readBin.read(long, byte[], int)public void write(long position,
byte[] bytes,
int bytesToWrite)
Binwrite in interface Binwrite in class BinDecoratorposition - the offset position to write atbytes - the array of bytes to writebytesToWrite - the number of bytes to writeBin.write(long, byte[], int)public void sync()
Binsync in interface Binsync in class BinDecoratorBin.sync()public void sync(java.lang.Runnable runnable)
Binsync in interface Binsync in class BinDecorator