be.SIRAPRISE.util
Class MyDataInputStream

java.lang.Object
  extended by be.SIRAPRISE.util.MyDataInputStream

public class MyDataInputStream
extends java.lang.Object

Author:
Erwin Smout

Constructor Summary
MyDataInputStream()
           
 
Method Summary
static java.lang.String getBigUTFString(java.io.DataInputStream in)
          Reads from the stream in a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a String.
static java.lang.String getSmallUTFString(java.io.DataInputStream in)
          Reads from the stream in a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a String.
static java.lang.String getUTFString(java.io.DataInputStream in, int charlength, int byteLength)
          Gets The String whose UTF-encoded bytes are the next bytes read from the inputStream argument
static byte[] readExactNumberOfBytes(java.io.DataInputStream in, int byteCount)
          Gets A byte array the size of byteCount holding the next bytes read from the inputStream argument
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyDataInputStream

public MyDataInputStream()
Method Detail

getBigUTFString

public static java.lang.String getBigUTFString(java.io.DataInputStream in)
                                        throws java.io.IOException
Reads from the stream in a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a String. The details of the modified UTF-8 representation are exactly the same as for the readUTF method of DataInput.

Parameters:
in - a data input stream.
Returns:
the string as decoded from the Unicode-encoded bytestream.
Throws:
java.io.IOException

getSmallUTFString

public static java.lang.String getSmallUTFString(java.io.DataInputStream in)
                                          throws java.io.IOException,
                                                 java.io.UTFDataFormatException
Reads from the stream in a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a String. The details of the modified UTF-8 representation are exactly the same as for the readUTF method of DataInput.

Parameters:
in - a data input stream.
Returns:
the string as decoded from the Unicode-encoded bytestream.
Throws:
java.io.IOException
java.io.UTFDataFormatException

getUTFString

public static java.lang.String getUTFString(java.io.DataInputStream in,
                                            int charlength,
                                            int byteLength)
                                     throws java.io.IOException,
                                            java.io.UTFDataFormatException
Gets The String whose UTF-encoded bytes are the next bytes read from the inputStream argument

Parameters:
in - The InputStream to read
charlength - The character length of the String
byteLength - The number of bytes that are to be read from the inputstream
Returns:
The String whose UTF-encoded bytes are the next bytes read from the inputStream argument
Throws:
java.io.IOException
java.io.UTFDataFormatException

readExactNumberOfBytes

public static byte[] readExactNumberOfBytes(java.io.DataInputStream in,
                                            int byteCount)
                                     throws java.io.IOException
Gets A byte array the size of byteCount holding the next bytes read from the inputStream argument

Parameters:
in - The InputStream to read
byteCount - the number of bytes to read
Returns:
A byte array the size of byteCount holding the next bytes read from the inputStream argument
Throws:
java.io.IOException