public final class Encoder extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
(专用程序包) BitOrder |
defaultBitOrder |
(专用程序包) ByteOrder |
defaultByteOrder |
(专用程序包) ByteBufferOutputStream |
outputStream |
| 限定符和类型 | 方法和说明 |
|---|---|
Encoder |
align(int alignment)
Align the current position to the specified byte boundary.
|
Encoder |
appendBool(BitOrder order,
boolean... values)
Encode boolean values into binary data.
|
Encoder |
appendBool(boolean... values)
Encode boolean values into binary data.
|
Encoder |
appendByte(byte... values)
Encode byte values into binary data.
|
Encoder |
appendBytes(byte[] bytes)
Encode byte array values into binary data.
|
Encoder |
appendDouble(ByteOrder order,
double... values)
Encode double values into binary data.
|
Encoder |
appendDouble(double... values)
Encode double values into binary data.
|
Encoder |
appendFloat(ByteOrder order,
float... values)
Encode float values into binary data.
|
Encoder |
appendFloat(float... values)
Encode float values into binary data.
|
Encoder |
appendInt16(ByteOrder order,
int... values)
Encode int16 values into binary data.
|
Encoder |
appendInt16(int... values)
Encode int16 values into binary data.
|
Encoder |
appendInt32(ByteOrder order,
int... values)
Encode int32 values into binary data.
|
Encoder |
appendInt32(int... values)
Encode int32 values into binary data.
|
Encoder |
appendInt64(ByteOrder order,
long... values)
Encode int64 values into binary data.
|
Encoder |
appendInt64(long... values)
Encode int64 values into binary data.
|
Encoder |
appendInt8(int... values)
Encode int8 values into binary data.
|
Encoder |
appendShort(ByteOrder order,
short... values)
Encode short values into binary data.
|
Encoder |
appendShort(short... values)
Encode short values into binary data.
|
Encoder |
appendUInt16(ByteOrder order,
int... values)
Encode uint16 values into binary data.
|
Encoder |
appendUInt16(int... values)
Encode uint16 values into binary data.
|
Encoder |
appendUInt32(ByteOrder order,
long... values)
Encode uint32 values into binary data.
|
Encoder |
appendUInt32(long... values)
Encode uint32 values into binary data.
|
Encoder |
appendUInt64(BigInteger... values)
Encode uint64 values into binary data.
|
Encoder |
appendUInt64(ByteOrder order,
BigInteger... values)
Encode uint64 values into binary data.
|
Encoder |
appendUInt8(int... values)
Encode uint8 values into binary data.
|
Encoder |
defaultBitOrder(BitOrder order)
Modify default bit order, FastProto uses lsb_0 by default if not specified.
|
Encoder |
defaultByteOrder(ByteOrder order)
Modify default byte order, FastProto uses little endian by default if not specified.
|
byte[] |
get()
Get the created binary data.
|
Encoder |
skip()
Ignore current position and move to next.
|
Encoder |
skip(int num)
Ignore following num positions and move to next.
|
Encoder |
writeBool(int byteOffset,
int bitOffset,
BitOrder order,
boolean... values)
Encode byte values into binary data.
|
Encoder |
writeBool(int byteOffset,
int bitOffset,
boolean... values)
Encode boolean values into binary data.
|
Encoder |
writeByte(int offset,
byte... values)
Encode byte values into binary data.
|
Encoder |
writeBytes(int offset,
byte[] bytes)
Encode byte array values into binary data.
|
Encoder |
writeDouble(int offset,
ByteOrder order,
double... values)
Encode double values into binary data.
|
Encoder |
writeDouble(int offset,
double... values)
Encode double values into binary data.
|
Encoder |
writeFloat(int offset,
ByteOrder order,
float... values)
Encode float values into binary data.
|
Encoder |
writeFloat(int offset,
float... values)
Encode float values into binary data.
|
Encoder |
writeInt16(int offset,
ByteOrder order,
int... values)
Encode int16 values into binary data.
|
Encoder |
writeInt16(int offset,
int... values)
Encode int16 values into binary data.
|
Encoder |
writeInt32(int offset,
ByteOrder order,
int... values)
Encode int32 values into binary data.
|
Encoder |
writeInt32(int offset,
int... values)
Encode int32 values into binary data.
|
Encoder |
writeInt64(int offset,
ByteOrder order,
long... values)
Encode int64 values into binary data.
|
Encoder |
writeInt64(int offset,
long... values)
Encode int64 values into binary data.
|
Encoder |
writeInt8(int offset,
int... values)
Encode int8 values into binary data.
|
Encoder |
writeShort(int offset,
ByteOrder order,
short... values)
Encode short values into binary data.
|
Encoder |
writeShort(int offset,
short... values)
Encode short values into binary data.
|
Encoder |
writeUInt16(int offset,
ByteOrder order,
int... values)
Encode uint16 values into binary data.
|
Encoder |
writeUInt16(int offset,
int... values)
Encode uint16 values into binary data.
|
Encoder |
writeUInt32(int offset,
ByteOrder order,
long... values)
Encode uint32 values into binary data.
|
Encoder |
writeUInt32(int offset,
long... values)
Encode uint32 values into binary data.
|
Encoder |
writeUInt64(int offset,
BigInteger... values)
Encode uint64 values into binary data.
|
Encoder |
writeUInt64(int offset,
ByteOrder order,
BigInteger... values)
Encode uint64 values into binary data.
|
Encoder |
writeUInt8(int offset,
int... values)
Encode uint8 values into binary data.
|
ByteBufferOutputStream outputStream
ByteOrder defaultByteOrder
BitOrder defaultBitOrder
public Encoder defaultByteOrder(ByteOrder order)
order - Byte orderpublic Encoder defaultBitOrder(BitOrder order)
order - Bit orderpublic Encoder appendBool(boolean... values)
values - Boolean values.public Encoder appendBool(BitOrder order, boolean... values)
order - The bit order of the boolean values in binary data.values - Boolean values.public Encoder writeBool(int byteOffset, int bitOffset, boolean... values)
byteOffset - The byte offset of the byte values in binary data.bitOffset - The bit offset of the byte values in binary data.values - Boolean values.public Encoder writeBool(int byteOffset, int bitOffset, BitOrder order, boolean... values)
byteOffset - The byte offset of the byte values in binary data.bitOffset - The bit offset of the byte values in binary data.order - The bit order of the byte values in binary data.values - Boolean values.public Encoder appendByte(byte... values)
values - Byte values.public Encoder writeByte(int offset, byte... values)
offset - The byte offset of the byte values in binary data.values - Byte values.public Encoder appendShort(short... values)
values - Short values.public Encoder appendShort(ByteOrder order, short... values)
order - The byte order of the short values in binary data.values - Short values.public Encoder writeShort(int offset, short... values)
offset - The byte offset of the short values in binary data.values - Short values.public Encoder writeShort(int offset, ByteOrder order, short... values)
offset - The byte offset of the short values in binary data.order - The byte order of the short values in binary data.values - Short values.public Encoder appendInt8(int... values)
values - Integer values.public Encoder writeInt8(int offset, int... values)
offset - The byte offset of the int8 values in binary data.values - Integer values.public Encoder appendInt16(int... values)
values - Integer values.public Encoder appendInt16(ByteOrder order, int... values)
order - The byte order of the int16 values in binary data.values - Integer values.public Encoder writeInt16(int offset, int... values)
offset - The byte offset of the int16 values in binary data.values - Integer values.public Encoder writeInt16(int offset, ByteOrder order, int... values)
offset - The byte offset of the int16 values in binary data.order - The byte order of the int16 values in binary data.values - Integer values.public Encoder appendInt32(int... values)
values - Integer values.public Encoder appendInt32(ByteOrder order, int... values)
order - The byte order of the int32 values in binary data.values - Integer values.public Encoder writeInt32(int offset, int... values)
offset - The byte offset of the int32 values in binary data.values - Integer values.public Encoder writeInt32(int offset, ByteOrder order, int... values)
offset - The byte offset of the int32 values in binary data.order - The byte order of the int32 values in binary data.values - Integer values.public Encoder appendInt64(long... values)
values - Integer values.public Encoder appendInt64(ByteOrder order, long... values)
order - The byte order of the int64 values in binary data.values - Integer values.public Encoder writeInt64(int offset, long... values)
offset - The byte offset of the int64 values in binary data.values - Integer values.public Encoder writeInt64(int offset, ByteOrder order, long... values)
offset - The byte offset of the int64 values in binary data.order - The byte order of the int64 values in binary data.values - Integer values.public Encoder appendUInt8(int... values)
values - uint8 values.public Encoder writeUInt8(int offset, int... values)
offset - The byte offset of the uint8 values in binary data.values - uint8 values.public Encoder appendUInt16(int... values)
values - uint16 values.public Encoder appendUInt16(ByteOrder order, int... values)
order - The byte order of the uint16 values in binary data.values - uint16 values.public Encoder writeUInt16(int offset, int... values)
offset - The byte offset of the uint16 values in binary data.values - uint16 values.public Encoder writeUInt16(int offset, ByteOrder order, int... values)
offset - The byte offset of the uint16 values in binary data.order - The byte order of the uint16 values in binary data.values - uint16 values.public Encoder appendUInt32(long... values)
values - uint32 values.public Encoder appendUInt32(ByteOrder order, long... values)
order - The byte order of the uint32 values in binary data.values - uint32 values.public Encoder writeUInt32(int offset, long... values)
offset - The byte offset of the uint32 values in binary data.values - uint32 values.public Encoder writeUInt32(int offset, ByteOrder order, long... values)
offset - The byte offset of the uint32 values in binary data.order - The byte order of the uint32 values in binary data.values - uint32 values.public Encoder appendUInt64(BigInteger... values)
values - uint64 values.public Encoder appendUInt64(ByteOrder order, BigInteger... values)
order - The byte order of the uint64 values in binary data.values - uint64 values.public Encoder writeUInt64(int offset, BigInteger... values)
offset - The byte offset of the uint64 values in binary data.values - uint64 values.public Encoder writeUInt64(int offset, ByteOrder order, BigInteger... values)
offset - The byte offset of the uint64 values in binary data.order - The byte order of the uint64 values in binary data.values - uint64 values.public Encoder appendFloat(float... values)
values - float values.public Encoder appendFloat(ByteOrder order, float... values)
order - The byte order of the float values in binary data.values - float values.public Encoder writeFloat(int offset, float... values)
offset - The byte offset of the float values in binary data.values - float values.public Encoder writeFloat(int offset, ByteOrder order, float... values)
offset - The byte offset of the float values in binary data.order - The byte order of the float values in binary data.values - float values.public Encoder appendDouble(double... values)
values - double values.public Encoder appendDouble(ByteOrder order, double... values)
order - The byte order of the double values in binary data.values - double values.public Encoder writeDouble(int offset, double... values)
offset - The byte offset of the double values in binary data.values - double values.public Encoder writeDouble(int offset, ByteOrder order, double... values)
offset - The byte offset of the double values in binary data.order - The byte order of the double values in binary data.values - double values.public Encoder appendBytes(byte[] bytes)
bytes - string values.public Encoder writeBytes(int offset, byte[] bytes)
offset - The byte offset of the byte array values in binary data.bytes - string values.public Encoder align(int alignment)
alignment - The byte boundary to align to.public Encoder skip()
public Encoder skip(int num)
num - The length to skip.public byte[] get()
Copyright © 2019–2025 indunet. All rights reserved.