com.ibm.mq.data

Class MQDataInputStream

  1. java.lang.Object
  2. extended byjava.io.InputStream
  3. extended byjava.io.FilterInputStream
  4. extended bycom.ibm.mq.data.MQDataInputStream
All implemented interfaces:
MQDataInput, java.io.Closeable

  1. public class MQDataInputStream
  2. extends java.io.FilterInputStream
  3. implements MQDataInput
Provides an InputStream implementation of MQDataInput. To use, wrap a source InputStream in the MQDataInputStream. Subsequent direct access to the source InputStream should be discouraged, as it will result in undefined behaviour from the MQDataInputStream.

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
COPYRIGHT
Fields inherited from class java.io.FilterInputStream
in

Constructor Summary

Constructor and Description
MQDataInputStream(java.io.InputStream in)

Method Summary

Modifier and Type Method and Description
  1. int
getCCSID()
  1. int
getDataOffset()
  1. DecimalEncoding
getDecimalEncoding()
  1. int
getEncoding()
  1. FloatEncoding
getFloatEncoding()
  1. IntegerEncoding
getIntegerEncoding()
  1. void
mark(int readLimit)
  1. int
read()
  1. int
read(byte[] b)
  1. int
read(byte[] b,int off,int len)
  1. byte
readByte()
  1. byte[]
readBytes(int length)
  1. java.math.BigInteger
readDecimal(int length)
  1. short
readDecimal2()
  1. int
readDecimal4()
  1. long
readDecimal8()
  1. double
readDouble()
  1. float
readFloat()
  1. void
readFully(byte[] b)
  1. void
readFully(byte[] b,int off,int len)
  1. int
readInt()
  1. long
readLong()
  1. byte
readMQBYTE()
  1. byte[]
readMQBYTE(int length)
  1. byte[]
readMQBYTE16()
  1. byte[]
readMQBYTE24()
  1. byte[]
readMQBYTE32()
  1. byte[]
readMQBYTE8()
  1. char
readMQCHAR()
  1. java.lang.String
readMQCHAR(int length)
  1. java.lang.String
readMQCHAR12()
  1. java.lang.String
readMQCHAR128()
  1. java.lang.String
readMQCHAR16()
  1. java.lang.String
readMQCHAR20()
  1. java.lang.String
readMQCHAR24()
  1. java.lang.String
readMQCHAR256()
  1. java.lang.String
readMQCHAR28()
  1. java.lang.String
readMQCHAR32()
  1. java.lang.String
readMQCHAR4()
  1. java.lang.String
readMQCHAR48()
  1. java.lang.String
readMQCHAR64()
  1. java.lang.String
readMQCHAR8()
  1. int
readMQINT32()
  1. long
readMQINT64()
  1. int
readMQLONG()
  1. short
readMQSHORT()
  1. long
readMQUINT32()
  1. java.math.BigInteger
readMQUINT64()
  1. long
readMQULONG()
  1. int
readMQUSHORT()
  1. java.lang.Object
readObject()
  1. short
readShort()
  1. char
readUCS2Char()
  1. java.lang.String
readUTF()
  1. void
reset()
  1. void
setCCSID(int ccsid)
  1. void
setDecimalEncoding(DecimalEncoding de)
  1. void
setEncoding(int encoding)
  1. void
setFloatEncoding(FloatEncoding fe)
  1. void
setIntegerEncoding(IntegerEncoding ie)
  1. long
skip(long n)
  1. int
skipBytes(int n)
Methods inherited from class java.io.FilterInputStream
available, close, markSupported
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

  1. public static final java.lang.String COPYRIGHT
See Also:

Constructor Detail

MQDataInputStream

  1. public MQDataInputStream(java.io.InputStream in)

Method Detail

setCCSID

  1. public void setCCSID(int ccsid)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Sets the Coded Character Set Identifier to be used for subsequent character read operations.
Specified by:
setCCSID in interface MQDataInput
Parameters:
ccsid - new CCSID value
Throws:
java.io.IOException

getCCSID

  1. public int getCCSID()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Returns the Coded Character Set Identifier currently used for character read operations
Specified by:
getCCSID in interface MQDataInput
Returns:
current CCSID value
Throws:
java.io.IOException

setIntegerEncoding

  1. public void setIntegerEncoding( IntegerEncoding ie)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Sets the IntegerEncoding to be uesd for subsequence integer read operations. IntegerEncoding.UNDEFINED is treated as IntegerEncoding.NORMAL.
Specified by:
Parameters:
ie - new integer encoding value
Throws:
java.io.IOException
See Also:

getIntegerEncoding

  1. public IntegerEncoding getIntegerEncoding( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Returns the IntegerEncoding currently used for integer read operations.
Specified by:
Returns:
current integer encoding
Throws:
java.io.IOException
See Also:

setFloatEncoding

  1. public void setFloatEncoding(FloatEncoding fe)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Sets the FloatEncoding to be used for subsequent floating-point read operations. FloatEncoding.UNDEFINED is treated as FloatEncoding.IEEE_NORMAL.
Specified by:
Parameters:
fe - new floating-point encoding value
Throws:
java.io.IOException
See Also:

getFloatEncoding

  1. public FloatEncoding getFloatEncoding( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Returns the FloatEncoding currently used for floating-point read operations.
Specified by:
Returns:
current floating-point encoding
Throws:
java.io.IOException
See Also:

setDecimalEncoding

  1. public void setDecimalEncoding( DecimalEncoding de)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Sets the DecimalEncoding to be used for subsequent packed-decimal read operations. DecimalEncoding.UNDEFINED is treated as DecimalEncoding.NORMAL
Specified by:
Parameters:
de - new packed-decimal encoding value
Throws:
java.io.IOException
See Also:

getDecimalEncoding

  1. public DecimalEncoding getDecimalEncoding( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Returns the DecimalEncoding currently used for packed-decimal read operations.
Specified by:
Returns:
current packed-decimal encoding
Throws:
java.io.IOException
See Also:

setEncoding

  1. public void setEncoding(int encoding)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Sets all three encoding values - integer, floating-point and packed-decimal, using the WMQ encoding identifier. These will be used for subsequent numeric read operations.
Specified by:
setEncoding in interface MQDataInput
Parameters:
encoding - integer representation of the new encoding
Throws:
java.io.IOException

getEncoding

  1. public int getEncoding()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Return the WMQ encoding identifier representing the three encodings (integer, floating-point and packed-decimal) currently used for numeric read operations.
Specified by:
getEncoding in interface MQDataInput
Returns:
integer representation of the current encoding
Throws:
java.io.IOException

mark

  1. public void mark(int readLimit)
Overrides:
mark in class java.io.FilterInputStream

reset

  1. public void reset()
  2. throws java.io.IOException
Overrides:
reset in class java.io.FilterInputStream
Throws:
java.io.IOException

getDataOffset

  1. public int getDataOffset()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Returns the current offset of the cursor, relative to the position where this MQDataOutput object was originally created. Behaviour is undefined if the underlying data source has been manipulated without going through this MQDataOutput object.
Specified by:
getDataOffset in interface MQDataInput
Returns:
number of bytes read or skipped
Throws:
java.io.IOException

skip

  1. public long skip(long n)
  2. throws java.io.IOException
Overrides:
skip in class java.io.FilterInputStream
Throws:
java.io.IOException

skipBytes

  1. public int skipBytes(int n)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Attempts to skip over a number of bytes, returning the number of bytes actually skipped.
Specified by:
skipBytes in interface MQDataInput
Parameters:
n - number of bytes to attempt to skip
Returns:
number of bytes actually skipped; 0 if at the end of the stream.
Throws:
java.io.IOException
See Also:
DataInput.skipBytes(int)

read

  1. public int read()
  2. throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

  1. public int read(byte[] b)
  2. throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

  1. public int read(byte[] b,
  2. int off,
  3. int len)
  4. throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

readByte

  1. public byte readByte()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a single (signed) byte.
Specified by:
readByte in interface MQDataInput
Returns:
byte read from stream
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readBytes

  1. public byte[] readBytes(int length)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a number of (signed) bytes from the stream, returning them as an array.
Specified by:
readBytes in interface MQDataInput
Parameters:
length - number of bytes to read
Returns:
an array containing the read bytes
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readMQBYTE

  1. public byte readMQBYTE()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a single (signed) byte.
Specified by:
readMQBYTE in interface MQDataInput
Returns:
byte read from stream
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readMQBYTE

  1. public byte[] readMQBYTE(int length)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a number of (signed) bytes from the stream, returning them as an array.
Specified by:
readMQBYTE in interface MQDataInput
Parameters:
length - number of bytes to read
Returns:
an array containing the read bytes
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readMQBYTE8

  1. public byte[] readMQBYTE8()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 8 bytes from the stream, returning them as an array.
Specified by:
readMQBYTE8 in interface MQDataInput
Returns:
an array containing the read bytes
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readMQBYTE16

  1. public byte[] readMQBYTE16()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 16 bytes from the stream, returning them as an array.
Specified by:
readMQBYTE16 in interface MQDataInput
Returns:
an array containing the read bytes
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readMQBYTE24

  1. public byte[] readMQBYTE24()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 24 bytes from the stream, returning them as an array.
Specified by:
readMQBYTE24 in interface MQDataInput
Returns:
an array containing the read bytes
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readMQBYTE32

  1. public byte[] readMQBYTE32()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 32 bytes from the stream, returning them as an array.
Specified by:
readMQBYTE32 in interface MQDataInput
Returns:
an array containing the read bytes
Throws:
java.io.EOFException - if at the end of the stream
java.io.IOException

readFully

  1. public void readFully(byte[] b)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads bytes into the parameter byte array.
Specified by:
readFully in interface MQDataInput
Parameters:
b - byte array to read into
Throws:
java.io.EOFException - if the stream does not have enough data left to fill the byte array
java.io.IOException
See Also:
DataInput.readFully(byte[])

readFully

  1. public void readFully(byte[] b,
  2. int off,
  3. int len)
  4. throws java.io.IOException
Description copied from interface: MQDataInput
Reads some number of bytes into a bytearray beginning from a given offset into the byte array.
Specified by:
readFully in interface MQDataInput
Parameters:
b - byte array to read into
off - starting index in the byte array
len - number of bytes to read
Throws:
java.io.EOFException - if the stream ends before len bytes have been read
java.io.IOException
See Also:
DataInput.readFully(byte[], int, int)

readMQCHAR

  1. public char readMQCHAR()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a single byte from the stream and converts it to a character, using the current CCSID. Fails if the next byte in the stream does not completely represent a single character.
Specified by:
readMQCHAR in interface MQDataInput
Returns:
a byte from the stream as a character
Throws:
java.io.EOFException - at end of stream
java.io.IOException - if the next byte does not completely represent a single character, or for unexpected errors.

readMQCHAR

  1. public java.lang.String readMQCHAR( int length)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a number of bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR in interface MQDataInput
Parameters:
length - number of bytes to read
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR4

  1. public java.lang.String readMQCHAR4( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 4 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR4 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR8

  1. public java.lang.String readMQCHAR8( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 8 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR8 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR12

  1. public java.lang.String readMQCHAR12( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 12 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR12 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR16

  1. public java.lang.String readMQCHAR16( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 16 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR16 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR20

  1. public java.lang.String readMQCHAR20( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 20 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR20 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR24

  1. public java.lang.String readMQCHAR24( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 24 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR24 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR28

  1. public java.lang.String readMQCHAR28( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 28 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR28 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR32

  1. public java.lang.String readMQCHAR32( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 32 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR32 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR48

  1. public java.lang.String readMQCHAR48( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 48 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR48 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR64

  1. public java.lang.String readMQCHAR64( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 64 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR64 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR128

  1. public java.lang.String readMQCHAR128( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 128 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR128 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readMQCHAR256

  1. public java.lang.String readMQCHAR256( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads 256 bytes from the stream and converts them into a String, using the current CCSID.
Specified by:
readMQCHAR256 in interface MQDataInput
Returns:
String read from the stream
Throws:
java.nio.charset.CharacterCodingException - if conversion fails
java.io.EOFException - at end of stream
java.io.IOException

readUCS2Char

  1. public char readUCS2Char()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads two bytes from the stream and interprets it as a Unicode character. The byte-order is determined by the current integer encoding.
Specified by:
readUCS2Char in interface MQDataInput
Returns:
a character read from the stream
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readUTF

  1. public java.lang.String readUTF( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a UTF-8 encoded string from the stream. The first two bytes of the stream give the length of the string. This is compatible with DataInput.writeUTF().
Specified by:
readUTF in interface MQDataInput
Returns:
a String, read from the stream
Throws:
java.io.EOFException - at end of stream
java.io.UTFDataFormatException - if the stream does not contain a valid UTF-8 string
java.io.IOException
See Also:
DataInput.readUTF()

readShort

  1. public short readShort()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads two bytes as a signed short. The byte order is determined by the current integer encoding.
Specified by:
readShort in interface MQDataInput
Returns:
the read short
Throws:
java.io.EOFException - at end of stream
java.io.IOException
See Also:
DataInput.readShort()

readMQSHORT

  1. public short readMQSHORT()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads two bytes as a signed short. The byte order is determined by the current integer encoding.
Specified by:
readMQSHORT in interface MQDataInput
Returns:
the read short
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readMQUSHORT

  1. public int readMQUSHORT()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads two bytes as an unsigned integer. The byte order is determined by the current integer encoding.
Specified by:
readMQUSHORT in interface MQDataInput
Returns:
a two-byte unsigned integer, as an int
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readInt

  1. public int readInt()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads four bytes as a signed integer. The byte order is determined by the current integer encoding.
Specified by:
readInt in interface MQDataInput
Returns:
the read int
Throws:
java.io.EOFException - at end of stream
java.io.IOException
See Also:
DataInput.readInt()

readMQLONG

  1. public int readMQLONG()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads four bytes as a signed integer. The byte order is determined by the current integer encoding.
Specified by:
readMQLONG in interface MQDataInput
Returns:
the read int
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readMQULONG

  1. public long readMQULONG()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads four bytes as an unsigned integer. The byte order is determined by the current integer encoding.
Specified by:
readMQULONG in interface MQDataInput
Returns:
a four-byte unsigned integer, as a long
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readMQINT32

  1. public int readMQINT32()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads four bytes as a signed integer. The byte order is determined by the current integer encoding.
Specified by:
readMQINT32 in interface MQDataInput
Returns:
the read int
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readMQUINT32

  1. public long readMQUINT32()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads four bytes as an unsigned integer. The byte order is determined by the current integer encoding.
Specified by:
readMQUINT32 in interface MQDataInput
Returns:
a four-byte unsigned integer, as a long
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readLong

  1. public long readLong()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads eight bytes as a signed long integer. The byte order is determined by the current integer encoding.
Specified by:
readLong in interface MQDataInput
Returns:
the read long
Throws:
java.io.EOFException - at end of stream
java.io.IOException
See Also:
DataInput.readLong()

readMQINT64

  1. public long readMQINT64()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads eight bytes as a signed long integer. The byte order is determined by the current integer encoding.
Specified by:
readMQINT64 in interface MQDataInput
Returns:
the read long
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readMQUINT64

  1. public java.math.BigInteger readMQUINT64( )
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads eight bytes as an unsigned integer. The byte order is determined by the current integer encoding.
Specified by:
readMQUINT64 in interface MQDataInput
Returns:
an eight-byte unsigned integer, as a BigInteger
Throws:
java.io.EOFException - at end of stream
java.io.IOException

readFloat

  1. public float readFloat()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads four bytes as a floating-point number, interpreted according to the current floating-point encoding. If the S390 encoding is used, this is the short HFP format. Note that conversion from this format to a Java float may lose precision.
Specified by:
readFloat in interface MQDataInput
Returns:
a four-byte precision floating point number.
Throws:
java.io.EOFException - at end of stream
java.io.IOException
See Also:
DataInput.readFloat()

readDouble

  1. public double readDouble()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads eight bytes as a floating-point number, interpreted according to the current floating-point encoding. If the S390 encoding is used, this is the long HFP format. Note that conversion from this format to a Java double may lose precision.
Specified by:
readDouble in interface MQDataInput
Returns:
an eight-byte precision floating point number.
Throws:
java.io.EOFException - at end of stream
java.io.IOException
See Also:
DataInput.readFloat()

readDecimal

  1. public java.math.BigInteger readDecimal( int length)
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads a number of bytes as a packed-decimal integer. The current packed-decimal encoding determines the byte order.

Unsigned packed-decimals are treated as positive; this method cannot distinguish between positive and negative zero.

Specified by:
readDecimal in interface MQDataInput
Parameters:
length - number of bytes to read
Returns:
the read packed-decimal number, as a BigInteger.
Throws:
java.io.EOFException - at end of stream
java.io.IOException - if a malformed packed-decimal is encountered, or for other error.

readDecimal2

  1. public short readDecimal2()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads two bytes as a packed-decimal integer. The current packed-decimal encoding determines the byte order.

Unsigned packed-decimals are treated as positive; this method cannot distinguish between positive and negative zero.

Specified by:
readDecimal2 in interface MQDataInput
Returns:
the read packed-decimal number, as a short, between -999 and 999 inclusive.
Throws:
java.io.EOFException - at end of stream
java.io.IOException - if a malformed packed-decimal is encountered, or for other error.

readDecimal4

  1. public int readDecimal4()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads four bytes as a packed-decimal integer. The current packed-decimal encoding determines the byte order.

Unsigned packed-decimals are treated as positive; this method cannot distinguish between positive and negative zero.

Specified by:
readDecimal4 in interface MQDataInput
Returns:
the read packed-decimal number, as an int, between -9999999 and 9999999 inclusive.
Throws:
java.io.EOFException - at end of stream
java.io.IOException - if a malformed packed-decimal is encountered, or for other error.

readDecimal8

  1. public long readDecimal8()
  2. throws java.io.IOException
Description copied from interface: MQDataInput
Reads eight bytes as a packed-decimal integer. The current packed-decimal encoding determines the byte order.

Unsigned packed-decimals are treated as positive; this method cannot distinguish between positive and negative zero.

Specified by:
readDecimal8 in interface MQDataInput
Returns:
the read packed-decimal number, as a long, between -1015 and 1015 exclusive
Throws:
java.io.EOFException - at end of stream
java.io.IOException - if a malformed packed-decimal is encountered, or for other error.

readObject

  1. public java.lang.Object readObject( )
  2. throws java.io.IOException
  3. java.lang.ClassNotFoundException
Description copied from interface: MQDataInput
Reads a serialized Java Object from the stream
Specified by:
readObject in interface MQDataInput
Returns:
a deserialized Object.
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
ObjectInput.readObject()