|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.database.RandomAccessDatabaseStream
| Field Summary | |
int |
maxBufferSize
|
static boolean |
unsafe
|
| Constructor Summary | |
RandomAccessDatabaseStream(File file,
String mode)
|
|
RandomAccessDatabaseStream(File file,
String mode,
boolean ignoreInconsistentState)
|
|
RandomAccessDatabaseStream(RandomAccessStream stream,
String mode)
|
|
RandomAccessDatabaseStream(RandomAccessStream stream,
String mode,
boolean ignoreInconsistentState)
|
|
| Method Summary | |
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()
|
protected int |
read(byte[] data,
int offset,
int 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 loc1,
int data1,
long loc2,
int data2)
|
void |
safeWrite(long loc1,
int data1,
long loc2,
int data2,
long loc3,
int data3,
long loc4,
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. |
protected void |
write(byte[] data,
int offset,
int 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public static boolean unsafe
public int maxBufferSize
| Constructor Detail |
public RandomAccessDatabaseStream(File file,
String mode)
throws IOException
public RandomAccessDatabaseStream(File file,
String mode,
boolean ignoreInconsistentState)
throws IOException
public RandomAccessDatabaseStream(RandomAccessStream stream,
String mode)
throws InconsistentDatabaseStateException,
IOException
public RandomAccessDatabaseStream(RandomAccessStream stream,
String mode,
boolean ignoreInconsistentState)
throws InconsistentDatabaseStateException,
IOException
| Method Detail |
public boolean canWrite()
DatabaseStream
canWrite in interface DatabaseStream
public boolean temporaryClose()
throws IOException
DatabaseStream
temporaryClose in interface DatabaseStreamIOException - if an error occurs.
public void reopen()
throws IOException
DatabaseStream
reopen in interface DatabaseStreamIOException - if an error occurs.public int getFirstDataLocation()
DatabaseStream
getFirstDataLocation in interface DatabaseStream
protected void write(byte[] data,
int offset,
int length)
throws IOException
IOException
protected int read(byte[] data,
int offset,
int length)
throws IOException
IOException
public void writeAll(long location,
byte[] data,
int offset,
int length)
throws IOException
writeAll in interface DatabaseStreamIOException
public void readAll(long location,
byte[] data,
int offset,
int length)
throws IOException
DatabaseStream
readAll in interface DatabaseStreamIOException
public void zero(long location,
int numBytes)
throws IOException
DatabaseStream
zero in interface DatabaseStreamIOException
public void flush()
throws IOException
flush in interface DatabaseStreamIOException
public boolean truncateTo(long length)
throws IOException
DatabaseStream
truncateTo in interface DatabaseStreamIOException
public int readIntAt(long location)
throws IOException
readIntAt in interface DatabaseStreamIOException
public void writeIntAt(long location,
int value)
throws IOException
writeIntAt in interface DatabaseStreamIOException
public void safeWrite(long location,
int data)
throws IOException
DatabaseStream
safeWrite in interface DatabaseStreamIOException
public void safeWrite(long loc1,
int data1,
long loc2,
int data2)
throws IOException
safeWrite in interface DatabaseStreamIOException
public void safeWrite(long loc1,
int data1,
long loc2,
int data2,
long loc3,
int data3,
long loc4,
int data4)
throws IOException
safeWrite in interface DatabaseStreamIOException
public boolean atEOF(long location)
throws IOException
atEOF in interface DatabaseStreamIOException
public long length()
throws IOException
length in interface DatabaseStreamIOException
public boolean setDecryptor(DataProcessor decryptor)
throws IOException
setDecryptor in interface DatabaseStreamIOException
public boolean setDecryptorAndEncryptor(DataProcessor decryptor,
DataProcessor encryptor)
throws IOException
setDecryptorAndEncryptor in interface DatabaseStreamIOException
public void close()
throws IOException
close in interface DatabaseStreamIOException
public void delete()
throws IOException
delete in interface DatabaseStreamIOException
public void rename(String newName)
throws IOException
rename in interface DatabaseStreamIOExceptionpublic Time getModifiedTime()
getModifiedTime in interface DatabaseStreampublic boolean setModifiedTime(Time t)
setModifiedTime in interface DatabaseStream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||