public class Serializer
extends java.lang.Object
implements java.io.DataOutput
Constructor and Description |
---|
Serializer(byte[] bytes,
int pos,
int len)
Serialize on bytes which starts from bytes[0]
to bytes[len - 1], with pos between 0 ~ (len
- 1)
|
Serializer(ByteArray byteArr) |
Modifier and Type | Method and Description |
---|---|
int |
getLength()
Get the length
|
int |
getPos()
Get the current position
|
void |
write(byte[] b)
Write the byte[] to the output stream
|
void |
write(byte[] b,
int off,
int length)
Write the byte[] of the length beginning from
the off to the output stream
|
void |
write(int b)
Write the value to the output stream
|
void |
writeBoolean(boolean v)
Write the boolean value to the output stream
|
void |
writeByte(int v)
Write the byte value to the output stream
|
void |
writeBytes(java.lang.String s)
Write the String value to the output stream
|
void |
writeChar(int v)
Write the char value to the output stream
|
void |
writeChars(java.lang.String s)
Write the String value to the output stream
|
void |
writeDouble(double v)
Write the double value to the output stream
|
void |
writeFloat(float v)
Write the float value to the output stream
|
void |
writeInt(int v)
Write the int value to the output stream
|
void |
writeLong(long v)
Write the long value to the output stream
|
void |
writeShort(int v)
Write the short value to the output stream
|
void |
writeUTF(java.lang.String s)
Write the String value to the output stream
|
public Serializer(ByteArray byteArr)
public Serializer(byte[] bytes, int pos, int len)
bytes
- the byte[]len
- the length of the byte[]pos
- the current position in the byte[]public int getPos()
public int getLength()
public void write(int b) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void write(byte[] b, int off, int length) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void writeBoolean(boolean v) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public void writeByte(int v) throws java.io.IOException
writeByte
in interface java.io.DataOutput
java.io.IOException
public void writeShort(int v) throws java.io.IOException
writeShort
in interface java.io.DataOutput
java.io.IOException
public void writeChar(int v) throws java.io.IOException
writeChar
in interface java.io.DataOutput
java.io.IOException
public void writeInt(int v) throws java.io.IOException
writeInt
in interface java.io.DataOutput
java.io.IOException
public void writeLong(long v) throws java.io.IOException
writeLong
in interface java.io.DataOutput
java.io.IOException
public void writeFloat(float v) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
java.io.IOException
public void writeDouble(double v) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
java.io.IOException
public void writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
java.io.IOException
public void writeChars(java.lang.String s) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
public void writeUTF(java.lang.String s) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException