public class HessianWriter extends Object implements com.caucho.hessian.io.Hessian2Constants
Modifier and Type | Field and Description |
---|---|
static int |
SIZE |
BC_BINARY, BC_BINARY_CHUNK, BC_BINARY_DIRECT, BC_BINARY_SHORT, BC_CLASS_DEF, BC_DATE, BC_DATE_MINUTE, BC_DOUBLE, BC_DOUBLE_BYTE, BC_DOUBLE_MILL, BC_DOUBLE_ONE, BC_DOUBLE_SHORT, BC_DOUBLE_ZERO, BC_END, BC_FALSE, BC_INT, BC_INT_BYTE_ZERO, BC_INT_SHORT_ZERO, BC_INT_ZERO, BC_LIST_DIRECT, BC_LIST_DIRECT_UNTYPED, BC_LIST_FIXED, BC_LIST_FIXED_UNTYPED, BC_LIST_VARIABLE, BC_LIST_VARIABLE_UNTYPED, BC_LONG, BC_LONG_BYTE_ZERO, BC_LONG_INT, BC_LONG_SHORT_ZERO, BC_LONG_ZERO, BC_MAP, BC_MAP_UNTYPED, BC_NULL, BC_OBJECT, BC_OBJECT_DEF, BC_OBJECT_DIRECT, BC_REF, BC_STRING, BC_STRING_CHUNK, BC_STRING_DIRECT, BC_STRING_SHORT, BC_TRUE, BINARY_DIRECT_MAX, BINARY_SHORT_MAX, INT_BYTE_MAX, INT_BYTE_MIN, INT_DIRECT_MAX, INT_DIRECT_MIN, INT_SHORT_MAX, INT_SHORT_MIN, LIST_DIRECT_MAX, LONG_BYTE_MAX, LONG_BYTE_MIN, LONG_DIRECT_MAX, LONG_DIRECT_MIN, LONG_SHORT_MAX, LONG_SHORT_MIN, OBJECT_DIRECT_MAX, P_PACKET, P_PACKET_CHUNK, P_PACKET_DIRECT, P_PACKET_SHORT, PACKET_DIRECT_MAX, PACKET_SHORT_MAX, STRING_DIRECT_MAX, STRING_SHORT_MAX
Constructor and Description |
---|
HessianWriter(Map nameMap) |
Modifier and Type | Method and Description |
---|---|
boolean |
addRef(Object object) |
void |
checkOverFlow(int len) |
byte[] |
getBuffer() |
byte[] |
getBytes() |
String |
getMappingName(String name) |
Map<String,String> |
getNameMap() |
int |
getOffset() |
HashMap<String,Integer> |
getTypeRefs() |
void |
printString(String v,
int strOffset,
int length)
Prints a string to the stream, encoded as UTF-8
|
void |
write(byte b) |
void |
write(byte[] bytes) |
void |
writeBoolean(boolean value) |
void |
writeBytes(byte[] data)
Writes a byte array to the stream.
|
void |
writeBytes(byte[] data,
int offset,
int length)
Writes a byte array to the stream.
|
void |
writeDouble(double value)
Writes a double value to the stream.
|
void |
writeInt(int value) |
boolean |
writeListBegin(int length,
String type)
Writes the list header to the stream.
|
void |
writeListEnd()
Writes the tail of the list to the stream for a variable-length list.
|
void |
writeMapBegin(String type)
Writes the map header to the stream.
|
void |
writeMapEnd()
Writes the tail of the map to the stream.
|
void |
writeNull() |
void |
writeObject(Object object) |
protected void |
writeRef(int value) |
void |
writeString(String value) |
public static final int SIZE
public HessianWriter(Map nameMap)
public int getOffset()
public byte[] getBuffer()
public void writeBoolean(boolean value)
public void writeInt(int value)
public void checkOverFlow(int len)
public void writeString(String value)
public byte[] getBytes()
public void printString(String v, int strOffset, int length)
v
- the string to print.public void writeBytes(byte[] data)
B b16 b18 bytes
If the value is null, it will be written as
N
param value the string value to write.public void writeBytes(byte[] data, int offset, int length)
B b16 b18 bytes
If the value is null, it will be written as
N
param value the string value to write.public void writeDouble(double value)
D b64 b56 b48 b40 b32 b24 b16 b8
value
- the double value to write.public boolean writeListBegin(int length, String type)
writeListBegin
followed by the list contents and then
call writeListEnd
.
list ::= V type value* Z
::= v type int value*
public void writeListEnd()
public void writeObject(Object object)
public boolean addRef(Object object)
protected void writeRef(int value)
public void writeMapBegin(String type)
writeMapBegin
followed by the map contents and then
call writeMapEnd
.
map ::= M type ( )* Z
::= H ( )* Z
public void writeMapEnd()
public void writeNull()
public void write(byte b)
public void write(byte[] bytes)
Copyright © 2016. All rights reserved.