public class MyDataInputStream
extends java.lang.Object
Constructor and Description |
---|
MyDataInputStream() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getBigUTFString(java.io.DataInput 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.DataInput 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.DataInput 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
|
public static java.lang.String getBigUTFString(java.io.DataInput in) throws java.io.IOException
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
.in
- a data input stream.java.io.IOException
- if an I/O exception occurredpublic static java.lang.String getSmallUTFString(java.io.DataInput in) throws java.io.IOException, java.io.UTFDataFormatException
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
.in
- a data input stream.java.io.IOException
- if an I/O exception occurredjava.io.UTFDataFormatException
- if UTF encoding errors were detectedpublic static java.lang.String getUTFString(java.io.DataInput in, int charlength, int byteLength) throws java.io.IOException, java.io.UTFDataFormatException
in
- The InputStream to readcharlength
- The character length of the StringbyteLength
- The number of bytes that are to be read from the inputstreamjava.io.IOException
- if an I/O exception occurredjava.io.UTFDataFormatException
- if UTF encoding errors were detectedpublic static byte[] readExactNumberOfBytes(java.io.DataInputStream in, int byteCount) throws java.io.IOException
in
- The InputStream to readbyteCount
- the number of bytes to readjava.io.IOException
- if an I/O exception occurred