public class Serialiser extends Object
Constructor and Description |
---|
Serialiser() |
Modifier and Type | Method and Description |
---|---|
double |
readDouble(DataInput input)
Read a
double written by writeDouble(java.io.DataOutput, double) . |
long |
readLong(DataInput input)
Read a
long written by writeLong(java.io.DataOutput, long) . |
long |
readUnsignedLong(DataInput input)
Read a
long written by writeUnsignedLong(java.io.DataOutput, long) . |
void |
writeDouble(DataOutput output,
double l)
Write a
double to a stream in such a way it can be
read by readDouble(java.io.DataInput) . |
void |
writeLong(DataOutput output,
long l)
Write a
long to a stream in such a way it can be
read by readLong(java.io.DataInput) . |
void |
writeUnsignedLong(DataOutput output,
long l)
Write a
long to a stream in such a way it can be
read by readUnsignedLong(java.io.DataInput) . |
public final void writeUnsignedLong(DataOutput output, long l) throws IOException
long
to a stream in such a way it can be
read by readUnsignedLong(java.io.DataInput)
. The value of the
long
must be greater than zero. Values between 0 and
127 inclusive require only one byte. Other values require eight
bytes.output
- The stream.l
- a long
valueIOException
- If the stream raises an error.public final long readUnsignedLong(DataInput input) throws IOException
long
written by writeUnsignedLong(java.io.DataOutput, long)
.input
- The stream.IOException
- If the stream raises an error.public final void writeLong(DataOutput output, long l) throws IOException
long
to a stream in such a way it can be
read by readLong(java.io.DataInput)
.
Efficient for small, positive longs. Values less than 16 take one byte. The worst cases (including all negative values) take nine bytes.
output
- The stream.l
- Value to write.IOException
- If the stream raises an error.public final long readLong(DataInput input) throws IOException
long
written by writeLong(java.io.DataOutput, long)
.input
- The stream.IOException
- If the stream raises an error.public final void writeDouble(DataOutput output, double l) throws IOException
double
to a stream in such a way it can be
read by readDouble(java.io.DataInput)
.output
- The stream.l
- The value.IOException
- If the stream raises an error.public final double readDouble(DataInput input) throws IOException
double
written by writeDouble(java.io.DataOutput, double)
.input
- The stream.IOException
- If the stream raises an error.Copyright © 2000-2014. All Rights Reserved.