- java.lang.Object
-
- org.redkale.convert.Writer
-
- org.redkale.convert.pb.ProtobufWriter
-
public abstract class ProtobufWriter extends Writer
- 作者:
- zhangjx
-
-
字段概要
字段 修饰符和类型 字段 说明 protected ProtobufBytesWriter
child
protected static int
CHILD_SIZE
protected int
count
protected static int
DEFAULT_SIZE
protected static byte[]
EMPTY_BYTES
protected boolean
enumtostring
protected ProtobufWriter
parent
protected Map<Stream,Object[]>
streamArrayCache
protected static byte[][]
TENTHOUSAND_FIXED32_BYTES
protected static byte[][]
TENTHOUSAND_FIXED32_BYTES2
protected static byte[][]
TENTHOUSAND_FIXED64_BYTES
protected static byte[][]
TENTHOUSAND_FIXED64_BYTES2
protected static int
TENTHOUSAND_MAX
protected static byte[][]
TENTHOUSAND_SINT32_BYTES
protected static byte[][]
TENTHOUSAND_SINT32_BYTES2
protected static byte[][]
TENTHOUSAND_SINT64_BYTES
protected static byte[][]
TENTHOUSAND_SINT64_BYTES2
protected static byte[][]
TENTHOUSAND_UINT_BYTES
protected static byte[][]
TENTHOUSAND_UINT_BYTES2
-
从类继承的字段 org.redkale.convert.Writer
comma, features, mapFieldFunc, objExtFunc, objFieldFunc, specificObjectType
-
-
构造器概要
构造器 限定符 构造器 说明 protected
ProtobufWriter()
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 void
clear()
protected ProtobufWriter
configFieldFunc(ProtobufWriter out)
ProtobufWriter
enumtostring(boolean enumtostring)
protected abstract int
expand(int len)
static byte[]
fixed32(int value)
static byte[]
fixed64(long value)
Object[]
getStreamArray(Stream stream)
int
length()
protected BiFunction
mapFieldFunc()
protected Function<Object,ConvertField[]>
objExtFunc()
protected BiFunction
objFieldFunc()
abstract void
offerChild(ProtobufWriter child)
abstract ProtobufWriter
pollChild()
Object[]
putStreamArray(Stream stream)
protected boolean
recycle()
static byte[]
sint32(int value)
static byte[]
sint64(long value)
abstract ByteArray
toByteArray()
String
toString()
static byte[]
uint32(int value)
static byte[]
uint64(long value)
ProtobufWriter
withFeatures(int features)
void
writeArrayB(int size, Encodeable componentEncoder, Object obj)
输出一个数组前的操作void
writeArrayE()
输出一个数组后的操作void
writeArrayMark()
输出数组元素间的间隔符void
writeBoolean(boolean value)
写入一个boolean值void
writeBools(boolean[] value)
void
writeBools(Boolean[] value)
void
writeBools(Collection<Boolean> value)
void
writeBools(Stream<Boolean> value)
void
writeByte(byte value)
写入一个byte值void
writeByteArray(byte[] values)
写入byte[]void
writeBytes(byte[] value)
void
writeBytes(Byte[] value)
void
writeBytes(Collection<Byte> value)
void
writeBytes(Stream<Byte> value)
void
writeChar(char value)
写入一个char值void
writeChars(char[] value)
void
writeChars(Character[] value)
void
writeChars(Collection<Character> value)
void
writeChars(Stream<Character> value)
void
writeDouble(double value)
写入一个double值void
writeDoubles(double[] value)
void
writeDoubles(Double[] value)
void
writeDoubles(Collection<Double> value)
void
writeDoubles(Stream<Double> value)
void
writeField(EnMember member)
输出一个字段名void
writeField(EnMember member, String fieldName, Type fieldType, int fieldPos)
输出一个字段名void
writeFieldBoolsValue(int tag, Collection<Boolean> value)
void
writeFieldBytesValue(int tag, Collection<Byte> value)
void
writeFieldCharsValue(int tag, Collection<Character> value)
void
writeFieldDoublesValue(int tag, Collection<Double> value)
void
writeFieldFloatsValue(int tag, Collection<Float> value)
void
writeFieldIntsValue(int tag, Collection<Integer> value)
void
writeFieldLongsValue(int tag, Collection<Long> value)
void
writeFieldShortsValue(int tag, Collection<Short> value)
void
writeFieldStringsValue(int tag, Collection<String> value)
void
writeFieldValue(int tag, boolean value)
void
writeFieldValue(int tag, boolean[] value)
void
writeFieldValue(int tag, byte value)
void
writeFieldValue(int tag, byte[] value)
void
writeFieldValue(int tag, char value)
void
writeFieldValue(int tag, char[] value)
void
writeFieldValue(int tag, double value)
void
writeFieldValue(int tag, double[] value)
void
writeFieldValue(int tag, float value)
void
writeFieldValue(int tag, float[] value)
void
writeFieldValue(int tag, int value)
void
writeFieldValue(int tag, int[] value)
void
writeFieldValue(int tag, long value)
void
writeFieldValue(int tag, long[] value)
void
writeFieldValue(int tag, short value)
void
writeFieldValue(int tag, short[] value)
void
writeFieldValue(int tag, Boolean value)
void
writeFieldValue(int tag, Boolean[] value)
void
writeFieldValue(int tag, Byte value)
void
writeFieldValue(int tag, Byte[] value)
void
writeFieldValue(int tag, Character value)
void
writeFieldValue(int tag, Character[] value)
void
writeFieldValue(int tag, Double value)
void
writeFieldValue(int tag, Double[] value)
void
writeFieldValue(int tag, Enum value)
void
writeFieldValue(int tag, Float value)
void
writeFieldValue(int tag, Float[] value)
void
writeFieldValue(int tag, Integer value)
void
writeFieldValue(int tag, Integer[] value)
void
writeFieldValue(int tag, Long value)
void
writeFieldValue(int tag, Long[] value)
void
writeFieldValue(int tag, Short value)
void
writeFieldValue(int tag, Short[] value)
void
writeFieldValue(int tag, String value)
void
writeFieldValue(int tag, String[] value)
void
writeFieldValue(int tag, SimpledCoder encoder, Object value)
protected void
writeFixed32(int value)
protected void
writeFixed64(long value)
void
writeFloat(float value)
写入一个float值void
writeFloats(float[] value)
void
writeFloats(Float[] value)
void
writeFloats(Collection<Float> value)
void
writeFloats(Stream<Float> value)
void
writeInt(int value)
写入一个int值void
writeInts(int[] value)
void
writeInts(Integer[] value)
void
writeInts(Collection<Integer> value)
void
writeInts(Stream<Integer> value)
protected void
writeLength(int value)
void
writeLong(long value)
写入一个long值void
writeLongs(long[] value)
void
writeLongs(Long[] value)
void
writeLongs(Collection<Long> value)
void
writeLongs(Stream<Long> value)
void
writeMapB(int size, Encodeable keyEncoder, Encodeable valueEncoder, Object obj)
输出一个Map前的操作void
writeMapE()
输出一个Map后的操作void
writeMapMark()
输出一个Map中key与value间的间隔符void
writeNull()
输出null值void
writeObjectB(Object obj)
输出一个对象前的操作 注: 覆盖此方法必须要先调用父方法 super.writeObjectB(obj);void
writeObjectE(Object obj)
输出一个对象后的操作void
writeObjectField(EnMember member, Object obj)
输出一个对象的某个字段protected abstract void
writeSelfLength(int value)
void
writeShort(short value)
写入一个short值void
writeShorts(short[] value)
void
writeShorts(Short[] value)
void
writeShorts(Collection<Short> value)
void
writeShorts(Stream<Short> value)
void
writeStandardString(String value)
写入无转义字符长度不超过255的字符串, 例如枚举值、字段名、类名字符串等 *void
writeString(String value)
写入一个String值void
writeStrings(int tag, String[] value)
void
writeStrings(int tag, Collection<String> value)
void
writeTag(int tag)
abstract void
writeTo(byte ch)
void
writeTo(byte... chs)
abstract void
writeTo(byte[] chs, int start, int len)
protected abstract void
writeUInt32(int value)
protected abstract void
writeUInt64(long value)
void
writeWrapper(StringWrapper value)
写入一个StringConvertWrapper值-
从类继承的方法 org.redkale.convert.Writer
getFeatures, nullable, specificObjectType, specificObjectType, tiny, writeObjectField, writeObjectNull
-
-
-
-
字段详细资料
-
DEFAULT_SIZE
protected static final int DEFAULT_SIZE
-
CHILD_SIZE
protected static final int CHILD_SIZE
- 另请参阅:
- 常量字段值
-
EMPTY_BYTES
protected static final byte[] EMPTY_BYTES
-
TENTHOUSAND_MAX
protected static final int TENTHOUSAND_MAX
- 另请参阅:
- 常量字段值
-
TENTHOUSAND_UINT_BYTES
protected static final byte[][] TENTHOUSAND_UINT_BYTES
-
TENTHOUSAND_UINT_BYTES2
protected static final byte[][] TENTHOUSAND_UINT_BYTES2
-
TENTHOUSAND_SINT32_BYTES
protected static final byte[][] TENTHOUSAND_SINT32_BYTES
-
TENTHOUSAND_SINT32_BYTES2
protected static final byte[][] TENTHOUSAND_SINT32_BYTES2
-
TENTHOUSAND_SINT64_BYTES
protected static final byte[][] TENTHOUSAND_SINT64_BYTES
-
TENTHOUSAND_SINT64_BYTES2
protected static final byte[][] TENTHOUSAND_SINT64_BYTES2
-
TENTHOUSAND_FIXED32_BYTES
protected static final byte[][] TENTHOUSAND_FIXED32_BYTES
-
TENTHOUSAND_FIXED32_BYTES2
protected static final byte[][] TENTHOUSAND_FIXED32_BYTES2
-
TENTHOUSAND_FIXED64_BYTES
protected static final byte[][] TENTHOUSAND_FIXED64_BYTES
-
TENTHOUSAND_FIXED64_BYTES2
protected static final byte[][] TENTHOUSAND_FIXED64_BYTES2
-
count
protected int count
-
enumtostring
protected boolean enumtostring
-
parent
protected ProtobufWriter parent
-
child
protected ProtobufBytesWriter child
-
-
方法详细资料
-
withFeatures
public final ProtobufWriter withFeatures(int features)
- 覆盖:
withFeatures
在类中Writer
-
configFieldFunc
protected final ProtobufWriter configFieldFunc(ProtobufWriter out)
-
mapFieldFunc
protected final BiFunction mapFieldFunc()
-
objFieldFunc
protected final BiFunction objFieldFunc()
-
objExtFunc
protected Function<Object,ConvertField[]> objExtFunc()
-
enumtostring
public ProtobufWriter enumtostring(boolean enumtostring)
-
clear
public void clear()
-
toByteArray
public abstract ByteArray toByteArray()
-
pollChild
public abstract ProtobufWriter pollChild()
-
offerChild
public abstract void offerChild(ProtobufWriter child)
-
expand
protected abstract int expand(int len)
-
writeTo
public abstract void writeTo(byte ch)
-
writeTo
public abstract void writeTo(byte[] chs, int start, int len)
-
writeSelfLength
protected abstract void writeSelfLength(int value)
-
writeUInt32
protected abstract void writeUInt32(int value)
-
writeUInt64
protected abstract void writeUInt64(long value)
-
writeTo
public final void writeTo(byte... chs)
-
length
public final int length()
-
writeBoolean
public final void writeBoolean(boolean value)
从类复制的说明:Writer
写入一个boolean值- 指定者:
writeBoolean
在类中Writer
- 参数:
value
- boolean值
-
writeObjectB
@ClassDepends public final void writeObjectB(Object obj)
从类复制的说明:Writer
输出一个对象前的操作 注: 覆盖此方法必须要先调用父方法 super.writeObjectB(obj);- 覆盖:
writeObjectB
在类中Writer
- 参数:
obj
- 写入的对象
-
writeObjectE
public final void writeObjectE(Object obj)
从类复制的说明:Writer
输出一个对象后的操作- 指定者:
writeObjectE
在类中Writer
- 参数:
obj
- 写入的对象
-
writeArrayB
public final void writeArrayB(int size, Encodeable componentEncoder, Object obj)
从类复制的说明:Writer
输出一个数组前的操作- 指定者:
writeArrayB
在类中Writer
- 参数:
size
- 数组长度componentEncoder
- Encodeableobj
- 对象, 不一定是数组、Collection对象,也可能是伪Collection对象
-
writeArrayMark
public final void writeArrayMark()
从类复制的说明:Writer
输出数组元素间的间隔符- 指定者:
writeArrayMark
在类中Writer
-
writeArrayE
public final void writeArrayE()
从类复制的说明:Writer
输出一个数组后的操作- 指定者:
writeArrayE
在类中Writer
-
writeMapB
public final void writeMapB(int size, Encodeable keyEncoder, Encodeable valueEncoder, Object obj)
从类复制的说明:Writer
输出一个Map前的操作
-
writeMapMark
public final void writeMapMark()
从类复制的说明:Writer
输出一个Map中key与value间的间隔符- 指定者:
writeMapMark
在类中Writer
-
writeField
public final void writeField(EnMember member)
输出一个字段名- 覆盖:
writeField
在类中Writer
- 参数:
member
- 字段
-
writeField
public final void writeField(EnMember member, String fieldName, Type fieldType, int fieldPos)
从类复制的说明:Writer
输出一个字段名- 指定者:
writeField
在类中Writer
- 参数:
member
- EnMemberfieldName
- 字段名称fieldType
- 字段类型fieldPos
- 字段顺序
-
writeByteArray
public final void writeByteArray(byte[] values)
从类复制的说明:Writer
写入byte[]- 指定者:
writeByteArray
在类中Writer
- 参数:
values
- byte[]
-
writeByte
public final void writeByte(byte value)
从类复制的说明:Writer
写入一个byte值
-
writeChar
public final void writeChar(char value)
从类复制的说明:Writer
写入一个char值
-
writeShort
public final void writeShort(short value)
从类复制的说明:Writer
写入一个short值- 指定者:
writeShort
在类中Writer
- 参数:
value
- short值
-
writeInt
public final void writeInt(int value)
从类复制的说明:Writer
写入一个int值
-
writeLong
public final void writeLong(long value)
从类复制的说明:Writer
写入一个long值
-
writeFloat
public final void writeFloat(float value)
从类复制的说明:Writer
写入一个float值- 指定者:
writeFloat
在类中Writer
- 参数:
value
- float值
-
writeDouble
public final void writeDouble(double value)
从类复制的说明:Writer
写入一个double值- 指定者:
writeDouble
在类中Writer
- 参数:
value
- double值
-
writeStandardString
public final void writeStandardString(String value)
从类复制的说明:Writer
写入无转义字符长度不超过255的字符串, 例如枚举值、字段名、类名字符串等 *- 指定者:
writeStandardString
在类中Writer
- 参数:
value
- 非空且不含需要转义的字符的String值
-
writeString
public final void writeString(String value)
从类复制的说明:Writer
写入一个String值- 指定者:
writeString
在类中Writer
- 参数:
value
- String值
-
writeStrings
public final void writeStrings(int tag, String[] value)
-
writeStrings
public final void writeStrings(int tag, Collection<String> value)
-
writeBools
public final void writeBools(boolean[] value)
-
writeBools
public final void writeBools(Boolean[] value)
-
writeBools
public final void writeBools(Collection<Boolean> value)
-
writeBytes
public final void writeBytes(byte[] value)
-
writeBytes
public final void writeBytes(Byte[] value)
-
writeBytes
public final void writeBytes(Collection<Byte> value)
-
writeChars
public final void writeChars(char[] value)
-
writeChars
public final void writeChars(Character[] value)
-
writeChars
public final void writeChars(Collection<Character> value)
-
writeShorts
public final void writeShorts(short[] value)
-
writeShorts
public final void writeShorts(Short[] value)
-
writeShorts
public final void writeShorts(Collection<Short> value)
-
writeInts
public final void writeInts(int[] value)
-
writeInts
public final void writeInts(Integer[] value)
-
writeInts
public final void writeInts(Collection<Integer> value)
-
writeFloats
public final void writeFloats(float[] value)
-
writeFloats
public final void writeFloats(Float[] value)
-
writeFloats
public final void writeFloats(Collection<Float> value)
-
writeLongs
public final void writeLongs(long[] value)
-
writeLongs
public final void writeLongs(Long[] value)
-
writeLongs
public final void writeLongs(Collection<Long> value)
-
writeDoubles
public final void writeDoubles(double[] value)
-
writeDoubles
public final void writeDoubles(Double[] value)
-
writeDoubles
public final void writeDoubles(Collection<Double> value)
-
writeWrapper
public final void writeWrapper(StringWrapper value)
从类复制的说明:Writer
写入一个StringConvertWrapper值- 指定者:
writeWrapper
在类中Writer
- 参数:
value
- StringConvertWrapper值
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, boolean value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, byte value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, char value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, short value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, int value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, float value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, long value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, double value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Boolean value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Byte value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Character value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Short value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Integer value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Float value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Long value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Double value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, boolean[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, byte[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, char[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, short[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, int[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, float[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, long[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, double[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Boolean[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Byte[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Character[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Short[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Integer[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Float[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Long[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Double[] value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, String[] value)
-
writeFieldBoolsValue
@ClassDepends public final void writeFieldBoolsValue(int tag, Collection<Boolean> value)
-
writeFieldBytesValue
@ClassDepends public final void writeFieldBytesValue(int tag, Collection<Byte> value)
-
writeFieldCharsValue
@ClassDepends public final void writeFieldCharsValue(int tag, Collection<Character> value)
-
writeFieldShortsValue
@ClassDepends public final void writeFieldShortsValue(int tag, Collection<Short> value)
-
writeFieldIntsValue
@ClassDepends public final void writeFieldIntsValue(int tag, Collection<Integer> value)
-
writeFieldFloatsValue
@ClassDepends public final void writeFieldFloatsValue(int tag, Collection<Float> value)
-
writeFieldLongsValue
@ClassDepends public final void writeFieldLongsValue(int tag, Collection<Long> value)
-
writeFieldDoublesValue
@ClassDepends public final void writeFieldDoublesValue(int tag, Collection<Double> value)
-
writeFieldStringsValue
@ClassDepends public final void writeFieldStringsValue(int tag, Collection<String> value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, String value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, Enum value)
-
writeFieldValue
@ClassDepends public final void writeFieldValue(int tag, SimpledCoder encoder, Object value)
-
writeObjectField
@ClassDepends public final void writeObjectField(@Nullable EnMember member, Object obj)
从类复制的说明:Writer
输出一个对象的某个字段- 覆盖:
writeObjectField
在类中Writer
- 参数:
member
- 字段obj
- 写入的对象
-
writeTag
@ClassDepends public final void writeTag(int tag)
-
writeLength
protected final void writeLength(int value)
-
writeFixed32
protected final void writeFixed32(int value)
-
writeFixed64
protected final void writeFixed64(long value)
-
uint32
public static byte[] uint32(int value)
-
uint64
public static byte[] uint64(long value)
-
sint32
public static byte[] sint32(int value)
-
sint64
public static byte[] sint64(long value)
-
fixed32
public static byte[] fixed32(int value)
-
fixed64
public static byte[] fixed64(long value)
-
-