IBM WebSphere Application ServerTM
Release 8

com.ibm.mq.data
Class MQDataInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.ibm.mq.data.MQDataInputStream
All Implemented Interfaces:
MQDataInput, java.io.Closeable

public class MQDataInputStream
extends java.io.FilterInputStream
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
static java.lang.String COPYRIGHT
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MQDataInputStream(java.io.InputStream in)
           
 
Method Summary
 int getCCSID()
          Returns the Coded Character Set Identifier currently used for character read operations
 int getDataOffset()
          Returns the current offset of the cursor, relative to the position where this MQDataOutput object was originally created.
 DecimalEncoding getDecimalEncoding()
          Returns the DecimalEncoding currently used for packed-decimal read operations.
 int getEncoding()
          Return the WMQ encoding identifier representing the three encodings (integer, floating-point and packed-decimal) currently used for numeric read operations.
 FloatEncoding getFloatEncoding()
          Returns the FloatEncoding currently used for floating-point read operations.
 IntegerEncoding getIntegerEncoding()
          Returns the IntegerEncoding currently used for integer read operations.
 void mark(int readLimit)
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 byte readByte()
          Reads a single (signed) byte.
 byte[] readBytes(int length)
          Reads a number of (signed) bytes from the stream, returning them as an array.
 java.math.BigInteger readDecimal(int length)
          Reads a number of bytes as a packed-decimal integer.
 short readDecimal2()
          Reads two bytes as a packed-decimal integer.
 int readDecimal4()
          Reads four bytes as a packed-decimal integer.
 long readDecimal8()
          Reads eight bytes as a packed-decimal integer.
 double readDouble()
          Reads eight bytes as a floating-point number, interpreted according to the current floating-point encoding.
 float readFloat()
          Reads four bytes as a floating-point number, interpreted according to the current floating-point encoding.
 void readFully(byte[] b)
          Reads bytes into the parameter byte array.
 void readFully(byte[] b, int off, int len)
          Reads some number of bytes into a bytearray beginning from a given offset into the byte array.
 int readInt()
          Reads four bytes as a signed integer.
 long readLong()
          Reads eight bytes as a signed long integer.
 byte readMQBYTE()
          Reads a single (signed) byte.
 byte[] readMQBYTE(int length)
          Reads a number of (signed) bytes from the stream, returning them as an array.
 byte[] readMQBYTE16()
          Reads 16 bytes from the stream, returning them as an array.
 byte[] readMQBYTE24()
          Reads 24 bytes from the stream, returning them as an array.
 byte[] readMQBYTE32()
          Reads 32 bytes from the stream, returning them as an array.
 byte[] readMQBYTE8()
          Reads 8 bytes from the stream, returning them as an array.
 char readMQCHAR()
          Reads a single byte from the stream and converts it to a character, using the current CCSID.
 java.lang.String readMQCHAR(int length)
          Reads a number of bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR12()
          Reads 12 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR128()
          Reads 128 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR16()
          Reads 16 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR20()
          Reads 20 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR24()
          Reads 24 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR256()
          Reads 256 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR28()
          Reads 28 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR32()
          Reads 32 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR4()
          Reads 4 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR48()
          Reads 48 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR64()
          Reads 64 bytes from the stream and converts them into a String, using the current CCSID.
 java.lang.String readMQCHAR8()
          Reads 8 bytes from the stream and converts them into a String, using the current CCSID.
 int readMQINT32()
          Reads four bytes as a signed integer.
 long readMQINT64()
          Reads eight bytes as a signed long integer.
 int readMQLONG()
          Reads four bytes as a signed integer.
 short readMQSHORT()
          Reads two bytes as a signed short.
 long readMQUINT32()
          Reads four bytes as an unsigned integer.
 java.math.BigInteger readMQUINT64()
          Reads eight bytes as an unsigned integer.
 long readMQULONG()
          Reads four bytes as an unsigned integer.
 int readMQUSHORT()
          Reads two bytes as an unsigned integer.
 java.lang.Object readObject()
          Reads a serialized Java Object from the stream
 short readShort()
          Reads two bytes as a signed short.
 char readUCS2Char()
          Reads two bytes from the stream and interprets it as a Unicode character.
 java.lang.String readUTF()
          Reads a UTF-8 encoded string from the stream.
 void reset()
           
 void setCCSID(int ccsid)
          Sets the Coded Character Set Identifier to be used for subsequent character read operations.
 void setDecimalEncoding(DecimalEncoding de)
          Sets the DecimalEncoding to be used for subsequent packed-decimal read operations.
 void setEncoding(int encoding)
          Sets all three encoding values - integer, floating-point and packed-decimal, using the WMQ encoding identifier.
 void setFloatEncoding(FloatEncoding fe)
          Sets the FloatEncoding to be used for subsequent floating-point read operations.
 void setIntegerEncoding(IntegerEncoding ie)
          Sets the IntegerEncoding to be uesd for subsequence integer read operations.
 long skip(long n)
           
 int skipBytes(int n)
          Attempts to skip over a number of bytes, returning the number of bytes actually skipped.
 
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

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Constructor Detail

MQDataInputStream

public MQDataInputStream(java.io.InputStream in)
Method Detail

setCCSID

public void setCCSID(int ccsid)
              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

public int getCCSID()
             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

public void setIntegerEncoding(IntegerEncoding ie)
                        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:
setIntegerEncoding in interface MQDataInput
Parameters:
ie - new integer encoding value
Throws:
java.io.IOException
See Also:
IntegerEncoding

getIntegerEncoding

public IntegerEncoding getIntegerEncoding()
                                   throws java.io.IOException
Description copied from interface: MQDataInput
Returns the IntegerEncoding currently used for integer read operations.

Specified by:
getIntegerEncoding in interface MQDataInput
Returns:
current integer encoding
Throws:
java.io.IOException
See Also:
IntegerEncoding

setFloatEncoding

public void setFloatEncoding(FloatEncoding fe)
                      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:
setFloatEncoding in interface MQDataInput
Parameters:
fe - new floating-point encoding value
Throws:
java.io.IOException
See Also:
FloatEncoding

getFloatEncoding

public FloatEncoding getFloatEncoding()
                               throws java.io.IOException
Description copied from interface: MQDataInput
Returns the FloatEncoding currently used for floating-point read operations.

Specified by:
getFloatEncoding in interface MQDataInput
Returns:
current floating-point encoding
Throws:
java.io.IOException
See Also:
FloatEncoding

setDecimalEncoding

public void setDecimalEncoding(DecimalEncoding de)
                        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:
setDecimalEncoding in interface MQDataInput
Parameters:
de - new packed-decimal encoding value
Throws:
java.io.IOException
See Also:
DecimalEncoding

getDecimalEncoding

public DecimalEncoding getDecimalEncoding()
                                   throws java.io.IOException
Description copied from interface: MQDataInput
Returns the DecimalEncoding currently used for packed-decimal read operations.

Specified by:
getDecimalEncoding in interface MQDataInput
Returns:
current packed-decimal encoding
Throws:
java.io.IOException
See Also:
DecimalEncoding

setEncoding

public void setEncoding(int encoding)
                 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

public int getEncoding()
                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

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

reset

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

getDataOffset

public int getDataOffset()
                  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

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

skipBytes

public int skipBytes(int n)
              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

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

read

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

read

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

readByte

public byte readByte()
              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

public byte[] readBytes(int length)
                 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

public byte readMQBYTE()
                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

public byte[] readMQBYTE(int length)
                  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

public byte[] readMQBYTE8()
                   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

public byte[] readMQBYTE16()
                    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

public byte[] readMQBYTE24()
                    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

public byte[] readMQBYTE32()
                    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

public void readFully(byte[] b)
               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

public void readFully(byte[] b,
                      int off,
                      int len)
               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

public char readMQCHAR()
                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

public java.lang.String readMQCHAR(int length)
                            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

public java.lang.String readMQCHAR4()
                             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

public java.lang.String readMQCHAR8()
                             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

public java.lang.String readMQCHAR12()
                              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

public java.lang.String readMQCHAR16()
                              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

public java.lang.String readMQCHAR20()
                              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

public java.lang.String readMQCHAR24()
                              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

public java.lang.String readMQCHAR28()
                              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

public java.lang.String readMQCHAR32()
                              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

public java.lang.String readMQCHAR48()
                              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

public java.lang.String readMQCHAR64()
                              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

public java.lang.String readMQCHAR128()
                               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

public java.lang.String readMQCHAR256()
                               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

public char readUCS2Char()
                  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

public java.lang.String readUTF()
                         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

public short readShort()
                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

public short readMQSHORT()
                  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

public int readMQUSHORT()
                 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

public int readInt()
            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

public int readMQLONG()
               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

public long readMQULONG()
                 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

public int readMQINT32()
                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

public long readMQUINT32()
                  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

public long readLong()
              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

public long readMQINT64()
                 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

public java.math.BigInteger readMQUINT64()
                                  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

public float readFloat()
                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

public double readDouble()
                  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

public java.math.BigInteger readDecimal(int length)
                                 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

public short readDecimal2()
                   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

public int readDecimal4()
                 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

public long readDecimal8()
                  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

public java.lang.Object readObject()
                            throws java.io.IOException,
                                   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()

IBM WebSphere Application ServerTM
Release 8