|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.util.DataStreamUtil
public final class DataStreamUtil
Utility methods for reading from data input streams and writing to data output streams.
| Method Summary | |
|---|---|
static byte[][] |
readByteArrays(DataInput in)
Reads an array of byte arrays from a data input stream. |
static byte[] |
readBytes(DataInput in)
Reads the number of bytes and the byte data from a data input stream and returns the resulting array. |
static long[] |
readLongs(DataInput in)
Reads an array of longs from a data input stream. |
static String |
readString(DataInput in)
Reads a string or null from a data input stream. |
static String[] |
readStrings(DataInput in)
Reads an array of strings from a data input stream. |
static void |
writeByteArrays(byte[][] array,
DataOutput out)
Writes an array of byte arrays to a data output stream. |
static void |
writeBytes(byte[] bytes,
DataOutput out)
Writes the number of bytes and the byte data to a data output stream. |
static void |
writeLongs(long[] array,
DataOutput out)
Writes an array of longs to a data output stream. |
static void |
writeString(String string,
DataOutput out)
Writes a string or null to a data output stream. |
static void |
writeStrings(String[] array,
DataOutput out)
Writes an array of strings to a data output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static byte[] readBytes(DataInput in)
throws IOException
null if the length is
-1.
in - the data input stream
null
IOException - if an I/O error occurs
public static void writeBytes(byte[] bytes,
DataOutput out)
throws IOException
-1 if the bytes are null
bytes - the bytes or nullout - the data output stream
IOException - if an I/O error occurs
public static String readString(DataInput in)
throws IOException
null from a data input stream. If the initial
boolean value is true, the next item is the UTF for the
string; otherwise, the string was null.
in - the data input stream
null
IOException - if an I/O error occurs
public static void writeString(String string,
DataOutput out)
throws IOException
null to a data output stream. Writes the
boolean value true followed by the UTF for the string
if it is not null, otherwise writes false.
string - the string or nullout - the data output stream
IOException - if an I/O error occurs
public static String[] readStrings(DataInput in)
throws IOException
null.
in - the data input stream
IOException - if an I/O error occurs
public static void writeStrings(String[] array,
DataOutput out)
throws IOException
null.
array - the arrayout - the data output stream
IOException - if an I/O error occurs
public static long[] readLongs(DataInput in)
throws IOException
longs from a data input stream.
in - the data input stream
IOException - if an I/O error occurs
public static void writeLongs(long[] array,
DataOutput out)
throws IOException
longs to a data output stream.
array - the arrayout - the data output stream
IOException - if an I/O error occurs
public static byte[][] readByteArrays(DataInput in)
throws IOException
in - the data input stream
byte arrays
IOException - if an I/O error occurs
public static void writeByteArrays(byte[][] array,
DataOutput out)
throws IOException
array - the array of byte arraysout - the data output stream
IOException - if an I/O error occurs
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||