|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.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 |
---|
afterRead, available, beforeRead, close, handleIOException, 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 fromMethod Detail |
---|
public boolean readBoolean() throws IOException, EOFException
readByte()
!= 0
readBoolean
in interface DataInput
IOException
- if an I/O error occurs
EOFException
- if an end of file is reached unexpectedlypublic byte readByte() throws IOException, EOFException
read()
method.
readByte
in interface DataInput
IOException
- if an I/O error occurs
EOFException
- if an end of file is reached unexpectedlypublic char readChar() throws IOException, EOFException
readShort()
.
readChar
in interface DataInput
IOException
- if an I/O error occurs
EOFException
- if an end of file is reached unexpectedlypublic double readDouble() throws IOException, EOFException
EndianUtils.readSwappedDouble(InputStream)
.
readDouble
in interface DataInput
IOException
- if an I/O error occurs
EOFException
- if an end of file is reached unexpectedlypublic float readFloat() throws IOException, EOFException
EndianUtils.readSwappedFloat(InputStream)
.
readFloat
in interface DataInput
IOException
- if an I/O error occurs
EOFException
- if an end of file is reached unexpectedlypublic void readFully(byte[] data) throws IOException, EOFException
read(byte[] data, int, int)
method.
readFully
in interface DataInput
data
- the buffer to read the bytes into
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic void readFully(byte[] data, int offset, int length) throws IOException, EOFException
read(byte[] data, int, int)
method.
readFully
in interface DataInput
data
- 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 occurspublic int readInt() throws IOException, EOFException
EndianUtils.readSwappedInteger(InputStream)
.
readInt
in interface DataInput
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic String readLine() throws IOException, EOFException
UnsupportedOperationException
.
readLine
in interface DataInput
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic long readLong() throws IOException, EOFException
EndianUtils.readSwappedLong(InputStream)
.
readLong
in interface DataInput
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic short readShort() throws IOException, EOFException
EndianUtils.readSwappedShort(InputStream)
.
readShort
in interface DataInput
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic int readUnsignedByte() throws IOException, EOFException
read()
method.
readUnsignedByte
in interface DataInput
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic int readUnsignedShort() throws IOException, EOFException
EndianUtils.readSwappedUnsignedShort(InputStream)
.
readUnsignedShort
in interface DataInput
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic String readUTF() throws IOException, EOFException
UnsupportedOperationException
.
readUTF
in interface DataInput
EOFException
- if an end of file is reached unexpectedly
IOException
- if an I/O error occurspublic int skipBytes(int count) throws IOException, EOFException
skip(int)
method.
skipBytes
in interface DataInput
count
- 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 |