|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.ProxyInputStream
org.apache.commons.io.input.SwappedDataInputStream
public class SwappedDataInputStream
DataInput for systems relying on little endian data formats. When read, values will be changed from little endian to big endian formats for internal usage.
Origin of code: Avalon Excalibur (IO)
| Field Summary |
|---|
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
SwappedDataInputStream(InputStream input)
Constructs a SwappedDataInputStream. |
|
| Method Summary | |
|---|---|
boolean |
readBoolean()
Return |
byte |
readByte()
Invokes the delegate's read() method. |
char |
readChar()
Reads a character delegating to readShort(). |
double |
readDouble()
Delegates to EndianUtils.readSwappedDouble(InputStream). |
float |
readFloat()
Delegates to EndianUtils.readSwappedFloat(InputStream). |
void |
readFully(byte[] data)
Invokes the delegate's read(byte[] data, int, int) method. |
void |
readFully(byte[] data,
int offset,
int length)
Invokes the delegate's read(byte[] data, int, int) method. |
int |
readInt()
Delegates to EndianUtils.readSwappedInteger(InputStream). |
String |
readLine()
Not currently supported - throws UnsupportedOperationException. |
long |
readLong()
Delegates to EndianUtils.readSwappedLong(InputStream). |
short |
readShort()
Delegates to EndianUtils.readSwappedShort(InputStream). |
int |
readUnsignedByte()
Invokes the delegate's read() method. |
int |
readUnsignedShort()
Delegates to EndianUtils.readSwappedUnsignedShort(InputStream). |
String |
readUTF()
Not currently supported - throws UnsupportedOperationException. |
int |
skipBytes(int count)
Invokes the delegate's skip(int) method. |
| Methods inherited from class org.apache.commons.io.input.ProxyInputStream |
|---|
available, close, mark, markSupported, read, read, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwappedDataInputStream(InputStream input)
input - InputStream to read from| Method Detail |
|---|
public boolean readBoolean()
throws IOException,
EOFException
readByte() == 0
readBoolean in interface DataInputIOException - if an I/O error occurs
EOFException - if an end of file is reached unexpectedly
public byte readByte()
throws IOException,
EOFException
read() method.
readByte in interface DataInputIOException - if an I/O error occurs
EOFException - if an end of file is reached unexpectedly
public char readChar()
throws IOException,
EOFException
readShort().
readChar in interface DataInputIOException - if an I/O error occurs
EOFException - if an end of file is reached unexpectedly
public double readDouble()
throws IOException,
EOFException
EndianUtils.readSwappedDouble(InputStream).
readDouble in interface DataInputIOException - if an I/O error occurs
EOFException - if an end of file is reached unexpectedly
public float readFloat()
throws IOException,
EOFException
EndianUtils.readSwappedFloat(InputStream).
readFloat in interface DataInputIOException - if an I/O error occurs
EOFException - if an end of file is reached unexpectedly
public void readFully(byte[] data)
throws IOException,
EOFException
read(byte[] data, int, int) method.
readFully in interface DataInputdata - the buffer to read the bytes into
EOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public void readFully(byte[] data,
int offset,
int length)
throws IOException,
EOFException
read(byte[] data, int, int) method.
readFully in interface DataInputdata - the buffer to read the bytes intooffset - The start offsetlength - The number of bytes to read
EOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public int readInt()
throws IOException,
EOFException
EndianUtils.readSwappedInteger(InputStream).
readInt in interface DataInputEOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public String readLine()
throws IOException,
EOFException
UnsupportedOperationException.
readLine in interface DataInputEOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public long readLong()
throws IOException,
EOFException
EndianUtils.readSwappedLong(InputStream).
readLong in interface DataInputEOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public short readShort()
throws IOException,
EOFException
EndianUtils.readSwappedShort(InputStream).
readShort in interface DataInputEOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public int readUnsignedByte()
throws IOException,
EOFException
read() method.
readUnsignedByte in interface DataInputEOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public int readUnsignedShort()
throws IOException,
EOFException
EndianUtils.readSwappedUnsignedShort(InputStream).
readUnsignedShort in interface DataInputEOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public String readUTF()
throws IOException,
EOFException
UnsupportedOperationException.
readUTF in interface DataInputEOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
public int skipBytes(int count)
throws IOException,
EOFException
skip(int) method.
skipBytes in interface DataInputcount - the number of bytes to skip
EOFException - if an end of file is reached unexpectedly
IOException - if an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||