public class CorruptRandomAccessFile
extends java.lang.Object
implements org.apache.derby.io.StorageRandomAccessFile
RandomAccessFile,
StorageRandomAccessFile| Modifier and Type | Field and Description |
|---|---|
private CorruptibleIo |
cbio |
private java.io.File |
realFile |
private org.apache.derby.io.StorageRandomAccessFile |
realRaf |
| Constructor and Description |
|---|
CorruptRandomAccessFile(org.apache.derby.io.StorageRandomAccessFile raf,
java.io.File realFile)
Construct a CorruptRandomAccessFile
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this file.
|
long |
getFilePointer()
Get the current offset in this file.
|
long |
length()
Gets the length of this file.
|
int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from this file into an
array of bytes. |
boolean |
readBoolean()
Reads a byte and returns true if the byte is not zero
otherwise false.
|
byte |
readByte()
returns one input byte from the stream.
|
char |
readChar()
returns a char value from the stream.
|
double |
readDouble()
returns a double from the stream.
|
float |
readFloat()
returns a float from the stream.
|
void |
readFully(byte[] b)
Reads some bytes from an input stream into the byte array.
|
void |
readFully(byte[] b,
int off,
int len)
Reads the specified number of bytes from an input stream.
|
int |
readInt()
returns an Int from the stream.
|
java.lang.String |
readLine()
returns the next line of text from the input stream.
|
long |
readLong()
returns a long from the stream.
|
short |
readShort()
returns a short value from the stream.
|
int |
readUnsignedByte()
Reads one input byte in the unsigned form.
|
int |
readUnsignedShort()
returns unsigned short.
|
java.lang.String |
readUTF()
returns a string that has been encoded using in the UTF-8 format.
|
void |
seek(long newFilePointer)
Set the file pointer.
|
void |
setLength(long newLength)
Sets the length of this file, either extending or truncating it.
|
int |
skipBytes(int nBytes)
skip over
nBytes bytes of data |
void |
sync()
Force any changes out to the persistent store.
|
void |
write(byte[] b)
Writes all the bytes in array to the stream.
|
void |
write(byte[] b,
int off,
int len)
Writes specified number bytes from array to the stream.
|
void |
write(int b)
Writes an int to the output stream .
|
void |
writeBoolean(boolean value)
Writes a boolean value to this output stream.
|
void |
writeByte(int value)
Writes to the eight low-order bits of ant int.
|
void |
writeBytes(java.lang.String str)
Writes a string as bytes to the stream.
|
void |
writeChar(int value)
Writes a char value to the output stream.
|
void |
writeChars(java.lang.String str)
Writes the string to the stream.
|
void |
writeDouble(double value)
Writes a a double value to the stream.
|
void |
writeFloat(float value)
Writes a float value to the output stream.
|
void |
writeInt(int value)
Writes an int value to the output stream.
|
void |
writeLong(long value)
Writes a long value to the output stream.
|
void |
writeShort(int value)
Writes a short value to the output stream
|
void |
writeUTF(java.lang.String str)
Writes the string in the utf format.
|
private org.apache.derby.io.StorageRandomAccessFile realRaf
private CorruptibleIo cbio
private java.io.File realFile
CorruptRandomAccessFile(org.apache.derby.io.StorageRandomAccessFile raf,
java.io.File realFile)
raf - The real random access file to which calls are delegated fro
this proxy class.public void close()
throws java.io.IOException
close in interface org.apache.derby.io.StorageRandomAccessFilejava.io.IOExceptionpublic long getFilePointer()
throws java.io.IOException
getFilePointer in interface org.apache.derby.io.StorageRandomAccessFilejava.io.IOExceptionpublic long length()
throws java.io.IOException
length in interface org.apache.derby.io.StorageRandomAccessFilejava.io.IOExceptionpublic void seek(long newFilePointer)
throws java.io.IOException
seek in interface org.apache.derby.io.StorageRandomAccessFilejava.io.IOExceptionpublic void setLength(long newLength)
throws java.io.IOException
setLength in interface org.apache.derby.io.StorageRandomAccessFilejava.io.IOExceptionpublic void sync()
throws java.io.IOException
sync in interface org.apache.derby.io.StorageRandomAccessFilejava.io.IOExceptionpublic void readFully(byte[] b)
throws java.io.IOException
readFully in interface java.io.DataInputjava.io.IOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws java.io.IOException
readFully in interface java.io.DataInputjava.io.IOExceptionpublic int skipBytes(int nBytes)
throws java.io.IOException
nBytes bytes of dataskipBytes in interface java.io.DataInputjava.io.IOExceptionpublic boolean readBoolean()
throws java.io.IOException
readBoolean in interface java.io.DataInputjava.io.IOExceptionpublic byte readByte()
throws java.io.IOException
readByte in interface java.io.DataInputjava.io.IOExceptionpublic int readUnsignedByte()
throws java.io.IOException
readUnsignedByte in interface java.io.DataInputjava.io.IOExceptionpublic short readShort()
throws java.io.IOException
readShort in interface java.io.DataInputjava.io.IOExceptionpublic int readUnsignedShort()
throws java.io.IOException
readUnsignedShort in interface java.io.DataInputjava.io.IOExceptionpublic char readChar()
throws java.io.IOException
readChar in interface java.io.DataInputjava.io.IOExceptionpublic int readInt()
throws java.io.IOException
readInt in interface java.io.DataInputjava.io.IOExceptionpublic long readLong()
throws java.io.IOException
readLong in interface java.io.DataInputjava.io.IOExceptionpublic float readFloat()
throws java.io.IOException
readFloat in interface java.io.DataInputjava.io.IOExceptionpublic double readDouble()
throws java.io.IOException
readDouble in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.String readLine()
throws java.io.IOException
readLine in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.String readUTF()
throws java.io.IOException
readUTF in interface java.io.DataInputjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in interface java.io.DataOutputjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in interface java.io.DataOutputjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in interface java.io.DataOutputjava.io.IOExceptionpublic void writeBoolean(boolean value)
throws java.io.IOException
writeBoolean in interface java.io.DataOutputjava.io.IOExceptionpublic void writeByte(int value)
throws java.io.IOException
writeByte in interface java.io.DataOutputjava.io.IOExceptionpublic void writeShort(int value)
throws java.io.IOException
writeShort in interface java.io.DataOutputjava.io.IOExceptionpublic void writeChar(int value)
throws java.io.IOException
writeChar in interface java.io.DataOutputvalue - the char value to be written.java.io.IOException - if an I/O error occurs.public void writeInt(int value)
throws java.io.IOException
writeInt in interface java.io.DataOutputjava.io.IOExceptionpublic void writeLong(long value)
throws java.io.IOException
writeLong in interface java.io.DataOutputjava.io.IOExceptionpublic void writeFloat(float value)
throws java.io.IOException
writeFloat in interface java.io.DataOutputjava.io.IOExceptionpublic void writeDouble(double value)
throws java.io.IOException
writeDouble in interface java.io.DataOutputjava.io.IOExceptionpublic void writeBytes(java.lang.String str)
throws java.io.IOException
writeBytes in interface java.io.DataOutputjava.io.IOExceptionpublic void writeChars(java.lang.String str)
throws java.io.IOException
writeChars in interface java.io.DataOutputjava.io.IOExceptionpublic void writeUTF(java.lang.String str)
throws java.io.IOException
writeUTF in interface java.io.DataOutputjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
len bytes of data from this file into an
array of bytes. This method blocks until at least one byte of input
is available.
read in interface org.apache.derby.io.StorageRandomAccessFileb - the buffer into which the data is read.off - the start offset in array b
at which the data is written.len - the maximum number of bytes read.-1 if there is no more data because the end of
the file has been reached.java.io.IOException - If the first byte cannot be read for any reason
other than end of file, or if the random access file has been closed, or
if some other I/O error occurs.java.lang.NullPointerException - If b is null.java.lang.IndexOutOfBoundsException - If off is negative,
len is negative, or len is greater than
b.length - offApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.