程序包 org.xmeta.codes
类 XerCoder
java.lang.Object
org.xmeta.codes.XerCoder
-
字段概要
字段修饰符和类型字段说明static final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byte -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static int从字节流里构建数据对象。static Thingdecode(Thing thing, InputStream input) static ThingdecodeAttributeOnly(byte[] bytes, int offset) 仅仅读取一个数据对象的属性。static intdecodeInt32(byte[] bytes) static longdecodeLong64(byte[] bytes) static voidencode(String name, Object value, String type, OutputStream out) static voidstatic void编码模型到字节缓存中。static void编码模型到输出流中。static voidencodeAllx(Thing thing, OutputStream out, Map<Thing, String> context) 编码所有。static byte[]encodeInt16(int value) static byte[]encodeInt32(int value) static byte[]encodeLong64(long value) static voidencodeName(OutputStream out, String name) static voidencodeString(String str, OutputStream out)
-
字段详细资料
-
NODE_START
public static final byte NODE_START- 另请参阅:
-
NODE_END
public static final byte NODE_END- 另请参阅:
-
CHILD_NODE
public static final byte CHILD_NODE- 另请参阅:
-
ATTRIBUTE
public static final byte ATTRIBUTE- 另请参阅:
-
VERSION
public static final byte VERSION- 另请参阅:
-
META
public static final byte META- 另请参阅:
-
TYPE_STRING
public static final byte TYPE_STRING- 另请参阅:
-
TYPE_BIGDECIMAL
public static final byte TYPE_BIGDECIMAL- 另请参阅:
-
TYPE_BIGINTEGER
public static final byte TYPE_BIGINTEGER- 另请参阅:
-
TYPE_BOOLEAN
public static final byte TYPE_BOOLEAN- 另请参阅:
-
TYPE_BYTE
public static final byte TYPE_BYTE- 另请参阅:
-
TYPE_BYTES
public static final byte TYPE_BYTES- 另请参阅:
-
TYPE_INT
public static final byte TYPE_INT- 另请参阅:
-
TYPE_DOUBLE
public static final byte TYPE_DOUBLE- 另请参阅:
-
TYPE_FLOAT
public static final byte TYPE_FLOAT- 另请参阅:
-
TYPE_CHAR
public static final byte TYPE_CHAR- 另请参阅:
-
TYPE_SHORT
public static final byte TYPE_SHORT- 另请参阅:
-
TYPE_OBJECT
public static final byte TYPE_OBJECT- 另请参阅:
-
TYPE_DATE
public static final byte TYPE_DATE- 另请参阅:
-
TYPE_LONG
public static final byte TYPE_LONG- 另请参阅:
-
-
构造器详细资料
-
XerCoder
public XerCoder()
-
-
方法详细资料
-
encodeString
- 抛出:
IOException
-
encodeInt16
public static byte[] encodeInt16(int value) -
encode1
public static void encode1(Thing thing, OutputStream out, Map<Thing, String> context) throws IOException编码模型到输出流中。- 参数:
thing- 模型out- 输出流context- 上下文- 抛出:
IOException- 异常
-
encode
public static void encode(Thing thing, OutputStream out, Map<Thing, String> context) throws IOException- 抛出:
IOException
-
encodeAllx
public static void encodeAllx(Thing thing, OutputStream out, Map<Thing, String> context) throws IOException编码所有。- 参数:
thing- 模型out- 输出流context- 上下文- 抛出:
IOException- 异常
-
encodeName
- 抛出:
IOException
-
encode
public static void encode(String name, Object value, String type, OutputStream out) throws IOException - 抛出:
IOException
-
decode
- 抛出:
IOException
-
decode
从字节流里构建数据对象。- 参数:
thing- 模型bytes- 字节数组offset- 偏移- 返回:
- 偏移量
- 抛出:
IOException- 异常
-
decodeAttributeOnly
public static Thing decodeAttributeOnly(byte[] bytes, int offset) throws UnsupportedEncodingException 仅仅读取一个数据对象的属性。- 参数:
bytes- 字节数组offset- 偏移- 返回:
- 模型
- 抛出:
UnsupportedEncodingException- 异常
-
encodeInt32
public static byte[] encodeInt32(int value) -
encodeLong64
public static byte[] encodeLong64(long value) -
decodeInt32
public static int decodeInt32(byte[] bytes) -
decodeLong64
public static long decodeLong64(byte[] bytes) -
encode
public static void encode(Thing thing, ByteBuffer buffer, Map<Thing, String> context) throws IOException编码模型到字节缓存中。- 参数:
thing- 模型buffer- 缓冲context- 上下文- 抛出:
IOException- 异常
-