public class SwappedDataInputStream extends ProxyInputStream implements DataInput
Origin of code: Avalon Excalibur (IO)
Constructor and Description |
---|
SwappedDataInputStream(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) . |
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. |
available, close, mark, markSupported, read, read, read, reset, skip
public SwappedDataInputStream(InputStream input)
input
- InputStream to read frompublic boolean readBoolean() throws IOException, EOFException
readByte()
!= 0
readBoolean
in interface DataInput
IOException
- if an I/O error occursEOFException
- 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 occursEOFException
- if an end of file is reached unexpectedlypublic char readChar() throws IOException, EOFException
readShort()
.readChar
in interface DataInput
IOException
- if an I/O error occursEOFException
- 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 occursEOFException
- 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 occursEOFException
- 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 intoEOFException
- if an end of file is reached unexpectedlyIOException
- 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 readEOFException
- if an end of file is reached unexpectedlyIOException
- 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 unexpectedlyIOException
- if an I/O error occurspublic String readLine() throws IOException, EOFException
UnsupportedOperationException
.readLine
in interface DataInput
EOFException
- if an end of file is reached unexpectedlyIOException
- 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 unexpectedlyIOException
- 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 unexpectedlyIOException
- 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 unexpectedlyIOException
- 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 unexpectedlyIOException
- if an I/O error occurspublic String readUTF() throws IOException, EOFException
UnsupportedOperationException
.readUTF
in interface DataInput
EOFException
- if an end of file is reached unexpectedlyIOException
- 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 skipEOFException
- if an end of file is reached unexpectedlyIOException
- if an I/O error occursJas4pp 1.5 © Java Analysis Studio for Particle Physics