|
||||||||||
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 com.google.common.io.LittleEndianDataInputStream
@Beta public final class LittleEndianDataInputStream
An implementation of DataInput
that uses little-endian byte ordering
for reading short
, int
, float
, double
, and
long
values.
Note: This class intentionally violates the specification of its
supertype DataInput
, which explicitly requires big-endian byte order.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
LittleEndianDataInputStream(InputStream in)
Creates a LittleEndianDataInputStream that wraps the given stream. |
Method Summary | |
---|---|
boolean |
readBoolean()
|
byte |
readByte()
|
char |
readChar()
Reads a char as specified by DataInputStream.readChar() , except
using little-endian byte order. |
double |
readDouble()
Reads a double as specified by
DataInputStream.readDouble() , except using little-endian byte
order. |
float |
readFloat()
Reads a float as specified by DataInputStream.readFloat() ,
except using little-endian byte order. |
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
Reads an integer as specified by DataInputStream.readInt() , except
using little-endian byte order. |
String |
readLine()
This method will throw an UnsupportedOperationException . |
long |
readLong()
Reads a long as specified by DataInputStream.readLong() ,
except using little-endian byte order. |
short |
readShort()
Reads a short as specified by DataInputStream.readShort() ,
except using little-endian byte order. |
int |
readUnsignedByte()
|
int |
readUnsignedShort()
Reads an unsigned short as specified by
DataInputStream.readUnsignedShort() , except using little-endian
byte order. |
String |
readUTF()
|
int |
skipBytes(int n)
|
Methods inherited from class java.io.FilterInputStream |
---|
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 LittleEndianDataInputStream(InputStream in)
LittleEndianDataInputStream
that wraps the given stream.
in
- the stream to delegate toMethod Detail |
---|
public String readLine()
UnsupportedOperationException
.
readLine
in interface DataInput
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
public int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public int readUnsignedShort() throws IOException
short
as specified by
DataInputStream.readUnsignedShort()
, except using little-endian
byte order.
readUnsignedShort
in interface DataInput
IOException
- if an I/O error occurspublic int readInt() throws IOException
DataInputStream.readInt()
, except
using little-endian byte order.
readInt
in interface DataInput
int
in little-endian byte order
IOException
- if an I/O error occurspublic long readLong() throws IOException
long
as specified by DataInputStream.readLong()
,
except using little-endian byte order.
readLong
in interface DataInput
long
in little-endian byte order
IOException
- if an I/O error occurspublic float readFloat() throws IOException
float
as specified by DataInputStream.readFloat()
,
except using little-endian byte order.
readFloat
in interface DataInput
float
in little-endian byte order
IOException
- if an I/O error occurspublic double readDouble() throws IOException
double
as specified by
DataInputStream.readDouble()
, except using little-endian byte
order.
readDouble
in interface DataInput
double
in little-endian byte order
IOException
- if an I/O error occurspublic String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public short readShort() throws IOException
short
as specified by DataInputStream.readShort()
,
except using little-endian byte order.
readShort
in interface DataInput
short
in little-endian byte order.
IOException
- if an I/O error occurs.public char readChar() throws IOException
DataInputStream.readChar()
, except
using little-endian byte order.
readChar
in interface DataInput
char
in little-endian byte order
IOException
- if an I/O error occurspublic byte readByte() throws IOException
readByte
in interface DataInput
IOException
public boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |