|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.entityfs.util.io.DataInputOutputRandomAccessAdapter
RandomAccessToDataInputOutputAdapter class instead.
@Deprecated public class DataInputOutputRandomAccessAdapter
This object adapts any RandomAccess implementation to implement the
DataInput and DataOutput interfaces.
Methods defined in the DataInput and DataOutput interfaces
throw IOException:s on errors. Methods defined in the
RandomAccess interface throw WrappedIOException:s.
The static fromModifiedUtf8(byte[]) and
toModifiedUtf(String) can be used to convert strings from and to the
modified UTF-8 data format defined in the DataInput
interface.
| Constructor Summary | |
|---|---|
DataInputOutputRandomAccessAdapter(RandomAccess adapted)
Deprecated. |
|
| Method Summary | |
|---|---|
void |
addCloseObserver(RandomAccessCloseObserver obs)
Deprecated. Add an observer that is notified when this RandomAccess is
closed. |
int |
available()
Deprecated. Returns an estimate of the number of bytes that can be read from this data source without blocking by the next invocation of a method for this data source. |
void |
close()
Deprecated. Close the sink and free all resources associated with it. |
protected void |
finalize()
Deprecated. |
void |
flush()
Deprecated. Flush changes made to the sink to the underlying storage. |
static String |
fromModifiedUtf8(byte[] barr)
Deprecated. Interpret the supplied byte array as modified UTF-8 data as described in the DataInput interface. |
long |
getFilePointer()
Deprecated. Get the current offset in the file. |
RandomAccessMode |
getMode()
Deprecated. Get the mode that this RandomAccess was opened in. |
long |
length()
Deprecated. Get the file's current length. |
int |
read()
Deprecated. Read a byte of data from the source. |
int |
read(byte[] barr)
Deprecated. Read up to b.length bytes of data from the source into the array. |
int |
read(byte[] barr,
int offset,
int len)
Deprecated. Read up to len bytes of data from the source into the array. |
boolean |
readBoolean()
Deprecated. |
byte |
readByte()
Deprecated. |
char |
readChar()
Deprecated. |
double |
readDouble()
Deprecated. |
float |
readFloat()
Deprecated. |
void |
readFully(byte[] barr)
Deprecated. |
void |
readFully(byte[] barr,
int offset,
int len)
Deprecated. |
int |
readInt()
Deprecated. |
String |
readLine()
Deprecated. |
long |
readLong()
Deprecated. |
short |
readShort()
Deprecated. |
int |
readUnsignedByte()
Deprecated. |
int |
readUnsignedShort()
Deprecated. |
String |
readUTF()
Deprecated. |
void |
seek(long pos)
Deprecated. Set the file pointer offset, measured from the beginning of the file. |
void |
setLength(long newlen)
Deprecated. Set the length of the file. |
int |
skipBytes(int no)
Deprecated. |
long |
skipBytes(long n)
Deprecated. Attempt to skip over n bytes in the source. |
static byte[] |
toModifiedUtf(String s)
Deprecated. Convert the supplied string to the modified UTF-8 format described in DataInput. |
void |
write(byte[] barr)
Deprecated. Write the contents of the array to the sink, starting at the current file pointer. |
void |
write(byte[] barr,
int offset,
int len)
Deprecated. Write len bytes from the array, starting at the offset off to this sink. |
void |
write(int b)
Deprecated. Write a byte to the sink. |
void |
writeBoolean(boolean b)
Deprecated. |
void |
writeByte(int v)
Deprecated. |
void |
writeBytes(String s)
Deprecated. |
void |
writeChar(int v)
Deprecated. |
void |
writeChars(String s)
Deprecated. |
void |
writeDouble(double d)
Deprecated. |
void |
writeFloat(float f)
Deprecated. |
void |
writeInt(int i)
Deprecated. |
void |
writeLong(long l)
Deprecated. |
void |
writeShort(int v)
Deprecated. |
void |
writeUTF(String s)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataInputOutputRandomAccessAdapter(RandomAccess adapted)
| Method Detail |
|---|
public boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOException
public void writeBoolean(boolean b)
throws IOException
writeBoolean in interface DataOutputIOException
public byte readByte()
throws IOException
readByte in interface DataInputIOException
public int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOException
public void writeByte(int v)
throws IOException
writeByte in interface DataOutputIOException
public void writeBytes(String s)
throws IOException
writeBytes in interface DataOutputIOException
public char readChar()
throws IOException
readChar in interface DataInputIOException
public void writeChar(int v)
throws IOException
writeChar in interface DataOutputIOException
public void writeChars(String s)
throws IOException
writeChars in interface DataOutputIOException
public double readDouble()
throws IOException
readDouble in interface DataInputIOException
public void writeDouble(double d)
throws IOException
writeDouble in interface DataOutputIOException
public long readLong()
throws IOException
readLong in interface DataInputIOException
public void writeLong(long l)
throws IOException
writeLong in interface DataOutputIOException
public float readFloat()
throws IOException
readFloat in interface DataInputIOException
public void writeFloat(float f)
throws IOException
writeFloat in interface DataOutputIOException
public int readInt()
throws IOException
readInt in interface DataInputIOException
public void writeInt(int i)
throws IOException
writeInt in interface DataOutputIOException
public short readShort()
throws IOException
readShort in interface DataInputIOException
public void writeShort(int v)
throws IOException
writeShort in interface DataOutputIOException
public int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOException
public void readFully(byte[] barr)
throws IOException
readFully in interface DataInputIOException
public void readFully(byte[] barr,
int offset,
int len)
throws IOException
readFully in interface DataInputIOException
public int skipBytes(int no)
throws IOException
skipBytes in interface DataInputno - Number of bytes to skip. No bytes are skipped if no is
negative.
IOExceptionpublic String readLine()
readLine in interface DataInput
public static String fromModifiedUtf8(byte[] barr)
throws UTFDataFormatException
DataInput interface.
barr - The modified UTF-8 data.
UTFDataFormatException - If the byte array cannot be interpreted as
a UTF-8 string.
public String readUTF()
throws IOException
readUTF in interface DataInputIOException
public static byte[] toModifiedUtf(String s)
throws UTFDataFormatException
DataInput.
s - The string to convert.
UTFDataFormatException - If the supplied string cannot be converted
to a byte array that is shorter than 65535 bytes.
public void writeUTF(String s)
throws IOException
writeUTF in interface DataOutputIOExceptionpublic RandomAccessMode getMode()
RandomAccessRandomAccess was opened in.
This method does not throw an IllegalStateException if it is
called after the RandomAccess has been closed.
getMode in interface RandomAccessRandomAccess was opened in.
public long getFilePointer()
throws WrappedIOException
RandomAccess
getFilePointer in interface RandomAccessWrappedIOException
public void write(int b)
throws WrappedIOException
DataSink
write in interface DataOutputwrite in interface DataSinkb - The byte to write.
WrappedIOException - On I/O errors.
public void write(byte[] barr)
throws WrappedIOException
DataSink
write in interface DataOutputwrite in interface DataSinkbarr - The array to write.
WrappedIOException - On I/O errors.
public void write(byte[] barr,
int offset,
int len)
throws WrappedIOException
DataSinklen bytes from the array, starting at the offset off to this sink.
write in interface DataOutputwrite in interface DataSinkbarr - The byte array.offset - The starting offset in the array.len - The number of bytes to write.
WrappedIOException - On I/O errors.
public void flush()
throws WrappedIOException
DataSinkReadOnlyException.
flush in interface DataSinkWrappedIOException - On I/O errors.
public int read()
throws WrappedIOException
DataSource0x00-0x0ff).
read in interface DataSource-1 if the end of the source has
been reached.
WrappedIOException - On I/O errors.
public int read(byte[] barr)
throws WrappedIOException
DataSourceb.length bytes of data from the source into the array.
read in interface DataSourcebarr - The byte array into which data is read.
-1 if
no data could be read because the the end of the source was reached
before the read started.
WrappedIOException - On I/O errors.
public int read(byte[] barr,
int offset,
int len)
throws WrappedIOException
DataSourcelen bytes of data from the source into the array.
read in interface DataSourcebarr - The byte array into which data is read.offset - The start offset in the array b at which data is
written.len - The maximum number of bytes to read.
-1 if
no data could be read because the end of the source was reached before
the read started.
WrappedIOException - On I/O errors.
public void close()
throws WrappedIOException
DataSink
close in interface DataSinkclose in interface DataSourceWrappedIOException - On I/O errors.public void addCloseObserver(RandomAccessCloseObserver obs)
RandomAccessRandomAccess is
closed. The observers are called just after the RandomAccess has
been closed.
addCloseObserver in interface RandomAccessobs - The observer.
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
public int available()
throws WrappedIOException
DataSource
available in interface DataSourceWrappedIOException - On I/O errors.InputStream.available()
public long length()
throws WrappedIOException
RandomAccess
length in interface RandomAccessWrappedIOException
public void setLength(long newlen)
throws WrappedIOException
RandomAccess
If the present length of the file is greater than the l argument,
the file will be truncated.
If the new length is bigger than the current length of the file, the file will be extended. The contents of the extended portion of the file are not defined.
The current file pointer is not changed, unless the file pointer offset is greater than the new file length. If so, it will be set to the new length.
setLength in interface RandomAccessnewlen - The new length of the file.
WrappedIOException
public void seek(long pos)
throws WrappedIOException
RandomAccess
seek in interface RandomAccesspos - The new file pointer offset, measured from the beginning of
the file.
WrappedIOExceptionDataSource.skipBytes(long)
public long skipBytes(long n)
throws WrappedIOException
DataSourcen bytes in the source. If n is
negative, no bytes are skipped.
The pointer in the source cannot be moved beyond EOF using this method
(unlike RandomAccess.seek(long)).
skipBytes in interface DataSourcen - The number of bytes to increment the source pointer with.
WrappedIOExceptionRandomAccess.seek(long)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||