|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--com.novell.java.io.EndianInputStream
Provides for writing primitive Java data types to a stream in an endian specific way.
Primitive data types are well understood types with associated operations. For example, an integer is considered to be a good primitive data type. The data can be converted back using an EndianInputStream.
EndianInput
Constructor Summary | |
EndianInputStream(byte[] buffer)
Creates a new EndianInputStream object that reads data from the specified byte array, which is not copied. |
|
EndianInputStream(byte[] buffer,
int offset,
int length)
Creates a new EndianInputStream object that reads data from the specified byte array. |
Method Summary | |
void |
align32()
Aligns a value a on 32-bit boundary. |
int |
available()
Returns the number of bytes that can be read from this input stream without blocking. |
void |
mark(int markpos)
Sets the current marked position in the stream. |
boolean |
markSupported()
Determines if EndianInputStream supports mark() and reset(). |
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] buffer,
int offset,
int length)
Reads up to the specified bytes of data into an array of bytes from this input stream. |
boolean |
readBoolean()
Reads a boolean value. |
byte |
readByte()
Reads an 8-bit byte. |
char |
readChar()
Reads a 16-bit char. |
double |
readDouble()
Reads a 64-bit double. |
float |
readFloat()
Reads a 32-bit float. |
void |
readFully(byte[] data)
Reads bytes of data into a buffer, blocking until all bytes are read. |
void |
readFully(byte[] data,
int offset,
int length)
Reads bytes of data into a buffer, blocking until all bytes are read. |
char |
readHiLoChar()
Reads a 16-bit char from high-low order. |
java.lang.String |
readHiLoChars()
Reads in a sequence of chars from high-low order that has been NULL-terminated or EOF. |
int |
readHiLoInt()
Reads a 32-bit int from high-low order. |
long |
readHiLoLong()
Reads a 64-bit long from high-low order. |
short |
readHiLoShort()
Reads a 16-bit short from high-low order. |
java.lang.String |
readHiLoString()
Reads in a sequence of chars from high-low order that has been length preceeded. |
int |
readInt()
Reads a 32-bit integer. |
java.lang.String |
readLine()
Reads in a line that has been terminated by a \n, \r, \r\n or EOF. |
char |
readLoHiChar()
Reads a 16-bit char from low-high order. |
java.lang.String |
readLoHiChars()
Reads in a sequence of chars from low-high order that has been NULL-terminated or EOF. |
int |
readLoHiInt()
Reads a 32-bit int from low-high order. |
long |
readLoHiLong()
Reads a 64-bit long from low-high order. |
short |
readLoHiShort()
Reads a 16-bit short from low-high order. |
long |
readLong()
Reads a 64-bit long. |
short |
readShort()
Reads an unsigned 8-bit byte. |
int |
readUnsignedByte()
Reads an unsigned 8-bit byte. |
int |
readUnsignedShort()
Reads an unsigned 16-bit short. |
java.lang.String |
readUString()
Deprecated. Reads in a sequence of chars from low-high order that has been length preceeded and null-terminated. |
java.lang.String |
readUTF()
Reads a UTF format String. |
void |
reset()
Resets the buffer to the marked position. |
long |
skip(long n)
Skips the specified bytes of input from this input stream. |
int |
skipBytes(int n)
Skips the specified bytes, block until all bytes are skipped. |
void |
unpad(int n)
Unpads a 32-bit value on the specified byte boundary. |
Methods inherited from class java.io.InputStream |
close,
read |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public EndianInputStream(byte[] buffer)
buffer
- The input byte array buffer.public EndianInputStream(byte[] buffer, int offset, int length)
buf
- The input buffer.offset
- The offset in the buffer for the first byte to read.length
- The maximum number of bytes to read from the buffer.Method Detail |
public int read()
public int read(byte[] buffer, int offset, int length)
buffer
- The buffer into which the data is to be read.offset
- The start offset of the data.length
- The maximum number of bytes to read.public long skip(long n)
n
- The number of bytes to be skipped.public int available()
public boolean markSupported()
public void mark(int markpos)
reset()
,
markSupported()
public void reset()
mark(int)
,
markSupported()
public final void readFully(byte[] data) throws java.io.IOException
data
- The buffer into which the data is readpublic final void readFully(byte[] data, int offset, int length) throws java.io.IOException
b
- The buffer into which the data is readoff
- The start offset of the datalen
- The maximum number of bytes to readpublic final int skipBytes(int n) throws java.io.IOException
n
- The number of bytes to be skippedpublic final boolean readBoolean() throws java.io.IOException
public final byte readByte() throws java.io.IOException
public final int readUnsignedByte() throws java.io.IOException
public final short readShort() throws java.io.IOException
public final int readUnsignedShort() throws java.io.IOException
public final char readChar() throws java.io.IOException
public final int readInt() throws java.io.IOException
public final long readLong() throws java.io.IOException
public final float readFloat() throws java.io.IOException
public final double readDouble() throws java.io.IOException
public java.lang.String readLine() throws java.io.IOException
public java.lang.String readUTF() throws java.io.IOException
public final char readHiLoChar() throws java.io.IOException
public final char readLoHiChar() throws java.io.IOException
public final java.lang.String readHiLoChars() throws java.io.IOException
public final java.lang.String readLoHiChars() throws java.io.IOException
public final java.lang.String readHiLoString() throws java.io.IOException
public final java.lang.String readUString() throws java.io.IOException
public final int readHiLoInt() throws java.io.IOException
public final int readLoHiInt() throws java.io.IOException
public final short readHiLoShort() throws java.io.IOException
public final short readLoHiShort() throws java.io.IOException
public final long readHiLoLong() throws java.io.IOException
public final long readLoHiLong() throws java.io.IOException
public final void align32() throws java.io.IOException
public final void unpad(int n) throws java.io.IOException
n
- The byte boundry.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |