|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.optional.io.DataCodingHelper
public abstract class DataCodingHelper
Static helper methods, which complement the functionality of
DataInput
and DataOutput
.
Constructor Summary | |
---|---|
DataCodingHelper()
|
Method Summary | |
---|---|
static int[] |
readDynamicIntArray(java.io.DataInput in,
int maxSize)
Read a dynamic integer array from the stream. |
static byte[] |
readDynamicOpaque(java.io.DataInput in,
int maxSize)
Read a dynamic opaque byte array from the stream. |
static int |
readUInt3(java.io.DataInput in)
Read a three-byte unsigned integer from a stream. |
static long |
readUInt4(java.io.DataInput in)
Read a four-byte unsigned integer from a stream. |
static void |
writeDynamicIntArray(java.io.DataOutput out,
int maxSize,
int[] arr)
Write a dynamic integer array to the stream. |
static void |
writeDynamicOpaque(java.io.DataOutput out,
int maxSize,
byte[] opaque)
Write a dynamic opaque byte array to the stream. |
static void |
writeUInt3(java.io.DataOutput out,
int x)
Write a three-byte unsigned integer value to the stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataCodingHelper()
Method Detail |
---|
public static void writeUInt3(java.io.DataOutput out, int x) throws java.io.IOException
out
- The stream to write to.x
- The value, of which the 24 low-order bits are written.
java.io.IOException
- Upon I/O errors.public static int readUInt3(java.io.DataInput in) throws java.io.IOException
in
- The stream to be read.
java.io.IOException
- Upon errors or premature end of stream.public static long readUInt4(java.io.DataInput in) throws java.io.IOException
in
- The stream to be read.
java.io.IOException
- Upon errors or premature end of stream.public static byte[] readDynamicOpaque(java.io.DataInput in, int maxSize) throws java.io.IOException
in
- The stream to read from.maxSize
- The maximal permissible size or a negative number for no size restrictions.
null
is returned.
java.io.IOException
- Upon read errors.public static void writeDynamicOpaque(java.io.DataOutput out, int maxSize, byte[] opaque) throws java.io.IOException
out
- The stream to write to.maxSize
- The maximal permissible size or a negative number for no size restrictions.opaque
- The byte array to write. If null
is passed in, an array of
length 0 written.
java.io.IOException
- Upon write errors.public static int[] readDynamicIntArray(java.io.DataInput in, int maxSize) throws java.io.IOException
in
- The stream to read from.maxSize
- The maximal permissible size or a negative number for no size restrictions.
int[]
with a size as specified in the length prefix
inside the stream. If the length in the stream is 0, null
is returned.
java.io.IOException
- Upon read errors.public static void writeDynamicIntArray(java.io.DataOutput out, int maxSize, int[] arr) throws java.io.IOException
out
- The stream to write to.maxSize
- The maximal permissible size or a negative number for no size restrictions.arr
- The int[]
to write. If null
is passed in, an array of
length 0 written.
java.io.IOException
- Upon write errors.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |