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