程序包 org.xmeta.codes
类 XerCoder
- java.lang.Object
-
- org.xmeta.codes.XerCoder
-
public class XerCoder extends Object
-
-
字段概要
字段 修饰符和类型 字段 说明 static byteATTRIBUTEstatic byteCHILD_NODEstatic byteMETAstatic byteNODE_ENDstatic byteNODE_STARTstatic byteTYPE_BIGDECIMALstatic byteTYPE_BIGINTEGERstatic byteTYPE_BOOLEANstatic byteTYPE_BYTEstatic byteTYPE_BYTESstatic byteTYPE_CHARstatic byteTYPE_DATEstatic byteTYPE_DOUBLEstatic byteTYPE_FLOATstatic byteTYPE_INTstatic byteTYPE_LONGstatic byteTYPE_OBJECTstatic byteTYPE_SHORTstatic byteTYPE_STRINGstatic byteVERSION
-
构造器概要
构造器 构造器 说明 XerCoder()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static intdecode(Thing thing, byte[] bytes, int offset)从字节流里构建数据对象。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 voidencode(Thing thing, OutputStream out, Map<Thing,String> context)static voidencode(Thing thing, ByteBuffer buffer, Map<Thing,String> context)编码模型到字节缓存中。static voidencode1(Thing thing, OutputStream out, Map<Thing,String> context)编码模型到输出流中。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
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
encodeString
public static void encodeString(String str, OutputStream out) throws IOException
- 抛出:
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
public static void encodeName(OutputStream out, String name) throws IOException
- 抛出:
IOException
-
encode
public static void encode(String name, Object value, String type, OutputStream out) throws IOException
- 抛出:
IOException
-
decode
public static Thing decode(Thing thing, InputStream input) throws IOException
- 抛出:
IOException
-
decode
public static int decode(Thing thing, byte[] bytes, int offset) throws IOException
从字节流里构建数据对象。- 参数:
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- 异常
-
-