public class SwappedDataInputStream extends ProxyInputStream implements java.io.DataInput
Origin of code: Avalon Excalibur (IO)
Constructor and Description |
---|
SwappedDataInputStream(java.io.InputStream input)
Constructs a SwappedDataInputStream.
|
Modifier and Type | Method and Description |
---|---|
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. |
available, close, mark, markSupported, read, read, read, reset, skip
public SwappedDataInputStream(java.io.InputStream input)
input
- InputStream to read frompublic 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 occursjava.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 occursjava.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 occursjava.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 occursjava.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 occursjava.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 intojava.io.EOFException
- if an end of file is reached unexpectedlyjava.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 readjava.io.EOFException
- if an end of file is reached unexpectedlyjava.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 unexpectedlyjava.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 unexpectedlyjava.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 unexpectedlyjava.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 unexpectedlyjava.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 unexpectedlyjava.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 unexpectedlyjava.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 unexpectedlyjava.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 skipjava.io.EOFException
- if an end of file is reached unexpectedlyjava.io.IOException
- if an I/O error occursCopyright © 2010 - 2020 Adobe. All Rights Reserved