public interface DatabaseStream
Modifier and Type | Method and Description |
---|---|
boolean |
atEOF(long location) |
boolean |
canWrite()
Tests if the DatabaseStream was opened in read-write mode as opposed to read-ony mode.
|
void |
close() |
void |
delete() |
void |
flush() |
int |
getFirstDataLocation()
Return the location of where you can store your data.
|
Time |
getModifiedTime() |
long |
length() |
void |
readAll(long location,
byte[] data,
int offset,
int length)
This throws an exception if all the specified bytes are not found at the specified
location.
|
int |
readIntAt(long location) |
void |
rename(String newName) |
void |
reopen()
Reopen the stream after a temporaryClose().
|
void |
safeWrite(long location,
int data)
A safeWrite() is one where the integer data is either stored completely at the specified
location or not at all.
|
void |
safeWrite(long location1,
int data1,
long location2,
int data2) |
void |
safeWrite(long location1,
int data1,
long location2,
int data2,
long location3,
int data3,
long location4,
int data4) |
boolean |
setDecryptor(DataProcessor decryptor) |
boolean |
setDecryptorAndEncryptor(DataProcessor decryptor,
DataProcessor encryptor) |
boolean |
setModifiedTime(Time t) |
boolean |
temporaryClose()
Close the stream temporarily.
|
boolean |
truncateTo(long length)
Try to truncate to a particular length.
|
void |
writeAll(long location,
byte[] data,
int offset,
int length) |
void |
writeIntAt(long location,
int value) |
void |
zero(long location,
int numBytes)
This should extend the Stream if necessary.
|
int getFirstDataLocation()
void safeWrite(long location, int data) throws IOException
IOException
void safeWrite(long location1, int data1, long location2, int data2) throws IOException
IOException
void safeWrite(long location1, int data1, long location2, int data2, long location3, int data3, long location4, int data4) throws IOException
IOException
int readIntAt(long location) throws IOException
IOException
void writeIntAt(long location, int value) throws IOException
IOException
void writeAll(long location, byte[] data, int offset, int length) throws IOException
IOException
void readAll(long location, byte[] data, int offset, int length) throws IOException
IOException
void zero(long location, int numBytes) throws IOException
IOException
boolean truncateTo(long length) throws IOException
IOException
boolean setDecryptor(DataProcessor decryptor) throws IOException
IOException
boolean setDecryptorAndEncryptor(DataProcessor decryptor, DataProcessor encryptor) throws IOException
IOException
boolean atEOF(long location) throws IOException
IOException
long length() throws IOException
IOException
void flush() throws IOException
IOException
void close() throws IOException
IOException
void delete() throws IOException
IOException
void rename(String newName) throws IOException
IOException
Time getModifiedTime() throws IOException
IOException
boolean setModifiedTime(Time t) throws IOException
IOException
boolean temporaryClose() throws IOException
IOException
- if an error occurs.void reopen() throws IOException
IOException
- if an error occurs.boolean canWrite()