public abstract class AbstractEncoder extends Object implements Encoder
Constructor and Description |
---|
AbstractEncoder() |
Modifier and Type | Method and Description |
---|---|
protected abstract int |
beginSize16() |
protected abstract int |
beginSize32() |
protected abstract int |
beginSize8() |
protected abstract void |
doPut(byte b) |
protected abstract void |
doPut(ByteBuffer src) |
protected abstract void |
endSize16(int pos) |
protected abstract void |
endSize32(int pos) |
protected abstract void |
endSize8(int pos) |
protected void |
put(byte b) |
protected void |
put(byte[] bytes) |
protected void |
put(ByteBuffer src) |
void |
writeArray(List<Object> array)
An array is an ordered sequence of values of the same type.
|
protected void |
writeArrayEntries(List<Object> array) |
void |
writeByteRanges(RangeSet ranges) |
void |
writeDatetime(long l)
The datetime type encodes a date and time using the 64 bit POSIX time_t format.
|
void |
writeList(List<Object> list)
A list is an ordered sequence of (type, value) pairs.
|
protected void |
writeListEntries(List<Object> list) |
void |
writeMap(Map<String,Object> map)
A map is a set of distinct keys where each key has an associated (type,value) pair.
|
protected void |
writeMapEntries(Map<String,Object> map) |
void |
writeSequenceNo(int i)
The sequence-no type encodes, in network byte order, a serial number as defined in RFC-1982.
|
void |
writeSequenceSet(RangeSet ranges) |
void |
writeStr16(String s)
The str16 type encodes up to 65535 octets worth of UTF-8 unicode.
|
void |
writeStr8(String s)
The str8 type encodes up to 255 octets worth of UTF-8 unicode.
|
void |
writeStruct(int type,
Struct s)
The struct32 type describes any coded struct with a 32-bit (4 octet) size.
|
void |
writeStruct32(Struct s)
The struct32 type describes any coded struct with a 32-bit (4 octet) size.
|
void |
writeUint16(int s)
The uint16 type is a 16-bit unsigned integral value encoded in network byte order.
|
void |
writeUint32(long i)
The uint32 type is a 32-bit unsigned integral value encoded in network byte order.
|
void |
writeUint64(long l)
The uint64 type is a 64-bit unsigned integral value encoded in network byte order.
|
void |
writeUint8(short b)
The uint8 type is an 8-bit unsigned integral value.
|
void |
writeUuid(UUID uuid)
The uuid type encodes a universally unique id as defined by RFC-4122.
|
void |
writeVbin16(byte[] bytes)
The vbin16 type encodes up to 65535 octets of opaque binary data.
|
void |
writeVbin32(byte[] bytes)
The vbin32 type encodes up to 4294967295 octets of opaque binary data.
|
void |
writeVbin8(byte[] bytes)
The vbin8 type encodes up to 255 octets of opaque binary data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, position, writeBin128, writeDouble, writeFloat, writeInt16, writeInt32, writeInt64, writeInt8
protected abstract void doPut(byte b)
protected abstract void doPut(ByteBuffer src)
protected void put(byte b)
protected void put(ByteBuffer src)
protected void put(byte[] bytes)
protected abstract int beginSize8()
protected abstract void endSize8(int pos)
protected abstract int beginSize16()
protected abstract void endSize16(int pos)
protected abstract int beginSize32()
protected abstract void endSize32(int pos)
public void writeUint8(short b)
Encoder
writeUint8
in interface Encoder
b
- the unsigned integer to be encoded.public void writeUint16(int s)
Encoder
writeUint16
in interface Encoder
s
- the unsigned integer to be encoded.public void writeUint32(long i)
Encoder
writeUint32
in interface Encoder
i
- the unsigned integer to be encoded.public void writeSequenceNo(int i)
Encoder
writeSequenceNo
in interface Encoder
i
- the sequence number to be encoded.public void writeUint64(long l)
Encoder
writeUint64
in interface Encoder
l
- the unsigned integer to be encoded.public void writeDatetime(long l)
Encoder
writeDatetime
in interface Encoder
l
- the datetime (as long) to be encoded.public void writeStr8(String s)
Encoder
public void writeStr16(String s)
Encoder
writeStr16
in interface Encoder
s
- the string to be encoded.public void writeVbin8(byte[] bytes)
Encoder
writeVbin8
in interface Encoder
bytes
- the byte array to be encoded.public void writeVbin16(byte[] bytes)
Encoder
writeVbin16
in interface Encoder
bytes
- the byte array to be encoded.public void writeVbin32(byte[] bytes)
Encoder
writeVbin32
in interface Encoder
bytes
- the byte array to be encoded.public void writeSequenceSet(RangeSet ranges)
writeSequenceSet
in interface Encoder
public void writeByteRanges(RangeSet ranges)
writeByteRanges
in interface Encoder
public void writeUuid(UUID uuid)
Encoder
public void writeStruct(int type, Struct s)
Encoder
writeStruct
in interface Encoder
type
- the type of the struct.s
- the struct to be encoded.public void writeStruct32(Struct s)
Encoder
writeStruct32
in interface Encoder
s
- the struct to be encoded.public void writeMap(Map<String,Object> map)
Encoder
public void writeList(List<Object> list)
Encoder
public void writeArray(List<Object> array)
Encoder
writeArray
in interface Encoder
array
- the array to be encoded.Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.