程序包 org.xmeta.codes
类 XerCoder
java.lang.Object
org.xmeta.codes.XerCoder
public class XerCoder extends Object
-
字段概要
字段 修饰符和类型 字段 说明 static byte
ATTRIBUTE
static byte
CHILD_NODE
static byte
META
static byte
NODE_END
static byte
NODE_START
static byte
TYPE_BIGDECIMAL
static byte
TYPE_BIGINTEGER
static byte
TYPE_BOOLEAN
static byte
TYPE_BYTE
static byte
TYPE_BYTES
static byte
TYPE_CHAR
static byte
TYPE_DATE
static byte
TYPE_DOUBLE
static byte
TYPE_FLOAT
static byte
TYPE_INT
static byte
TYPE_LONG
static byte
TYPE_OBJECT
static byte
TYPE_SHORT
static byte
TYPE_STRING
static byte
VERSION
-
构造器概要
构造器 构造器 说明 XerCoder()
-
方法概要
修饰符和类型 方法 说明 static int
decode(Thing thing, byte[] bytes, int offset)
从字节流里构建数据对象。static Thing
decode(Thing thing, InputStream input)
static Thing
decodeAttributeOnly(byte[] bytes, int offset)
仅仅读取一个数据对象的属性。static int
decodeInt32(byte[] bytes)
static long
decodeLong64(byte[] bytes)
static void
encode(String name, Object value, String type, OutputStream out)
static void
encode(Thing thing, OutputStream out, Map<Thing,String> context)
static void
encode(Thing thing, ByteBuffer buffer, Map<Thing,String> context)
编码模型到字节缓存中。static void
encode1(Thing thing, OutputStream out, Map<Thing,String> context)
编码模型到输出流中。static void
encodeAllx(Thing thing, OutputStream out, Map<Thing,String> context)
编码所有。static byte[]
encodeInt16(int value)
static byte[]
encodeInt32(int value)
static byte[]
encodeLong64(long value)
static void
encodeName(OutputStream out, String name)
static void
encodeString(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
- 异常
-