|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream com.ibm.websphere.objectgrid.io.XsDataInputStream
public abstract class XsDataInputStream
A random access, byte-oriented, portable stream for reading primitive types and string.
This stream combines the facilities of
DataOutput
plus unsigned values
ByteBuffer
.
This class is not intended as a base class for user code to extend. Instances of XsDataInputStream are provided solely by the WebSphere eXtreme Scale runtime for use by plug-ins.
Constructor Summary | |
---|---|
XsDataInputStream()
|
Method Summary | |
---|---|
abstract ByteOrder |
getByteOrder()
Gets the byte order for writing multi-byte data. |
abstract String |
getEncodingScheme()
Gets canonical name of the current string encoding scheme. |
abstract boolean |
isClosed()
Affirms if this stream has been closed. |
abstract int |
position()
Gets the current position from where the next byte will be read. |
abstract XsDataInputStream |
position(int i)
Positions this stream to read from the given position. |
abstract boolean |
readBoolean()
Reads 1-byte as a boolean value at the current position in current byte order. |
abstract byte |
readByte()
Reads 1-byte as a signed byte value at the current position in current byte order. |
abstract char |
readChar()
Reads 2-byte as an signed integer value in the current position in current byte order. |
abstract void |
readChars(char[] c)
Reads c.length characters as an array of 2-byte signed integer values in the current position in current byte order. |
abstract double |
readDouble()
Reads a 8-byte floating point number at the current position in current byte order. |
abstract float |
readFloat()
Reads a 4-byte floating point number at the current position in current byte order. |
abstract void |
readFully(byte[] b)
Reads b.length bytes, if available. |
abstract void |
readFully(byte[] b,
int off,
int len)
Reads b.length bytes, if available. |
abstract int |
readInt()
Reads a 4-byte integer at the current position in current byte order. |
abstract long |
readLong()
Reads a 8-byte integer number at the current position in current byte order. |
abstract short |
readShort()
Reads a 2-byte signed integer number at the current position in current byte order. |
abstract String |
readString()
Reads a string assuming that the number of bytes of the string to be read precedes the actual bytes as a 2-byte short number. |
abstract String |
readString(String encoding)
Reads a string assuming that the number of bytes of the string to be read precedes the actual bytes as a 2-byte short number. |
abstract String |
readString(String encoding,
boolean lengthPrepended,
int L,
boolean nullTerminated)
Reads a string as a array of bytes with given parameter specifications. |
abstract String |
readStringAsNullTerminated()
Reads a string assuming that the string to be read is terminated by a single bye of value 0. |
abstract String |
readStringAsNullTerminated(String encoding)
Reads a string assuming that the string to be read is terminated by a single bye of value 0. |
abstract String |
readStringRaw(int L)
Reads a string as a array of bytes of given length. |
abstract String |
readStringRaw(String encoding,
int L)
Reads a string as a array of bytes of given length. |
abstract int |
readUnsignedByte()
Reads 1-byte as an unsigned byte value at the current position in current byte order. |
abstract int |
readUnsignedShort()
Reads a 2-byte unsigned integer number at the current position in current byte order. |
abstract String |
readUTF8String()
Reads a string as an array of bytes with the UTF-8 encoding The length is stored in a varint at the current position in the stream to indicate the number of UTF-8 bytes that will follow in the buffer. |
abstract int |
readVarintAsInt()
Reads a variable length integer number at the current position in the current byte order. |
abstract long |
readVarintAsLong()
Reads a variable length long number at the current position in the current byte order. |
abstract XsDataInputStream |
rewind()
Rewinds the stream by reopening, if necessary and repositioning at the state of construction. |
abstract boolean |
setByteOrder(ByteOrder order)
Sets the byte order of the data. |
abstract void |
setEncodingScheme(String enc)
Sets the current string encoding scheme. |
abstract int |
size()
Gets the total number of bytes in this stream. |
abstract byte[] |
toByteArray()
Gets the underlying bytes of this stream. |
abstract ByteBuffer |
toByteBuffer(ByteBuffer buffer)
Transfers the underlying bytes of this stream to the given byte buffer at current position. |
Methods inherited from class java.io.InputStream |
---|
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 XsDataInputStream()
Method Detail |
---|
public abstract XsDataInputStream position(int i) throws IOException
i
- a position in this stream
IOException
- if the position is less than 0 or more than the size of this
streampublic abstract int position() throws IOException
IOException
public abstract int size() throws IOException
IOException
public abstract boolean isClosed()
public abstract boolean readBoolean() throws IOException
IOException
public abstract byte readByte() throws IOException
IOException
public abstract int readUnsignedByte() throws IOException
IOException
public abstract void readFully(byte[] b, int off, int len) throws IOException
b
- array of bytes to be populated. Must not be null.off
- an offset index. Must be positive.len
- number of bytes to read. Must be positive.
IOException
public abstract void readFully(byte[] b) throws IOException
IOException
public abstract char readChar() throws IOException
IOException
public abstract void readChars(char[] c) throws IOException
IOException
public abstract int readInt() throws IOException
IOException
public abstract float readFloat() throws IOException
IOException
public abstract double readDouble() throws IOException
IOException
public abstract long readLong() throws IOException
IOException
public abstract short readShort() throws IOException
IOException
public abstract int readUnsignedShort() throws IOException
IOException
public abstract int readVarintAsInt() throws IOException
IOException
public abstract long readVarintAsLong() throws IOException
IOException
public abstract String getEncodingScheme()
public abstract void setEncodingScheme(String enc)
enc
- canonical name of an encoding scheme.public abstract boolean setByteOrder(ByteOrder order)
order
- BIG_ENDIAN or LITTLE_ENDIAN byte order
public abstract ByteOrder getByteOrder()
public abstract String readString() throws IOException
method
of readUTF.
IOException
public abstract String readString(String encoding) throws IOException
IOException
public abstract String readStringAsNullTerminated() throws IOException
IOException
public abstract String readStringAsNullTerminated(String encoding) throws IOException
IOException
public abstract String readStringRaw(int L) throws IOException
IOException
public abstract String readStringRaw(String encoding, int L) throws IOException
IOException
public abstract String readString(String encoding, boolean lengthPrepended, int L, boolean nullTerminated) throws IOException
lengthPrepended
- if true, then a 2-byte short is read from the current position
of the stream itself. The value read is assumed to be the number of bytes in the string.
The next two parameters are ignored.L
- if the lengthPrepended and nullTerminated parameter are both false,
then this value is considered to be the number of bytes in the string.nullTerminated
- if true and the lengthPrepended is false, then scans the stream from the
current position to find a byte of value 0 as the terminating character of the string to be read.
IOException
public abstract String readUTF8String() throws IOException
IOException
public abstract XsDataInputStream rewind()
public abstract byte[] toByteArray()
public abstract ByteBuffer toByteBuffer(ByteBuffer buffer)
buffer
- a non-null buffer
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |