- java.lang.Object
-
- org.redkale.convert.Reader
-
- org.redkale.convert.pb.ProtobufReader
-
- 直接已知子类:
ProtobufByteBufferReader
public class ProtobufReader extends Reader
- 作者:
- zhangjx
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.redkale.convert.Reader
Reader.ValueType
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Integer
cacheTag
protected int
limit
protected static Creator
LIS_CREATOR
protected int
position
-
从类继承的字段 org.redkale.convert.Reader
SIGN_NULL, SIGN_VARIABLE
-
-
构造器概要
构造器 构造器 说明 ProtobufReader()
ProtobufReader(byte[] bytes)
ProtobufReader(byte[] bytes, int start, int len)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
backTag(int tag)
ProtobufReader
clear()
boolean
hasNext()
是否还存在下个元素或字段int
limit()
void
limit(int limit)
int
position()
获取当前位置void
prepare(byte[] bytes)
设置Reader的内容,通常结合对象池使用int
readArrayB(Decodeable componentDecoder)
判断下一个非空白字符是否为[void
readArrayE()
读取数组的尾端void
readBlank()
判断下一个非空白字节是否:boolean
readBoolean()
读取一个boolean值boolean[]
readBools()
Collection<Boolean>
readBools(Creator<? extends Collection> creator)
byte
readByte()
读取一个byte值byte[]
readByteArray()
读取byte[]byte[]
readBytes()
Collection<Byte>
readBytes(Creator<? extends Collection> creator)
char
readChar()
读取一个char值char[]
readChars()
Collection<Character>
readChars(Creator<? extends Collection> creator)
double
readDouble()
读取一个double值double[]
readDoubles()
Collection<Double>
readDoubles(Creator<? extends Collection> creator)
DeMember
readField(DeMemberInfo memberInfo)
根据字段读取字段对应的DeMemberfloat
readFloat()
读取一个float值float[]
readFloats()
Collection<Float>
readFloats(Creator<? extends Collection> creator)
int
readInt()
读取一个int值int[]
readInts()
Collection<Integer>
readInts(Creator<? extends Collection> creator)
long
readLong()
读取一个long值long[]
readLongs()
Collection<Long>
readLongs(Creator<? extends Collection> creator)
int
readMapB(Decodeable keyDecoder, Decodeable valueDecoder)
读取map的开头并返回map的sizevoid
readMapE()
读取数组的尾端boolean
readNextTag(int memberTag)
boolean
readNextTag(DeMember member)
String
readObjectB(Class clazz)
读取对象的类名, 返回 null 表示对象为null, 返回空字符串表示当前class与返回的class一致,返回非空字符串表示class是当前class的子类。void
readObjectE(Class clazz)
读取对象的尾端protected int
readRawLittleEndian32()
protected long
readRawLittleEndian64()
protected int
readRawVarint32()
protected long
readRawVarint64()
protected long
readRawVarint64SlowPath()
short
readShort()
读取一个short值short[]
readShorts()
Collection<Short>
readShorts(Creator<? extends Collection> creator)
String
readStandardString()
读取无转义字符长度不超过255的字符串, 例如枚举值、字段名、类名字符串等String
readString()
读取一个String值String[]
readStrings(int tag)
Collection<String>
readStrings(int tag, Creator<? extends Collection> creator)
protected int
readTag()
Reader.ValueType
readType()
读取下个值的类型protected boolean
recycle()
byte[]
remainBytes()
ProtobufReader
setBytes(byte[] bytes)
ProtobufReader
setBytes(byte[] bytes, int start, int len)
void
skipValue()
跳过属性的值
-
-
-
方法详细资料
-
prepare
public void prepare(byte[] bytes)
从类复制的说明:Reader
设置Reader的内容,通常结合对象池使用
-
setBytes
public final ProtobufReader setBytes(byte[] bytes)
-
setBytes
public final ProtobufReader setBytes(byte[] bytes, int start, int len)
-
limit
public void limit(int limit)
-
limit
public int limit()
-
recycle
protected boolean recycle()
-
clear
public ProtobufReader clear()
-
readObjectB
public final String readObjectB(Class clazz)
从类复制的说明:Reader
读取对象的类名, 返回 null 表示对象为null, 返回空字符串表示当前class与返回的class一致,返回非空字符串表示class是当前class的子类。- 覆盖:
readObjectB
在类中Reader
- 参数:
clazz
- 类名- 返回:
- 返回字段数
-
readObjectE
public final void readObjectE(Class clazz)
从类复制的说明:Reader
读取对象的尾端- 指定者:
readObjectE
在类中Reader
- 参数:
clazz
- 类名
-
readMapB
public final int readMapB(Decodeable keyDecoder, Decodeable valueDecoder)
从类复制的说明:Reader
读取map的开头并返回map的size
-
readArrayB
public final int readArrayB(Decodeable componentDecoder)
判断下一个非空白字符是否为[- 指定者:
readArrayB
在类中Reader
- 参数:
componentDecoder
- Decodeable- 返回:
- SIGN_VARIABLE 或 SIGN_NULL
- 另请参阅:
Reader.SIGN_NULL
,Reader.SIGN_VARIABLE
-
readArrayE
public final void readArrayE()
从类复制的说明:Reader
读取数组的尾端- 指定者:
readArrayE
在类中Reader
-
readField
public final DeMember readField(DeMemberInfo memberInfo)
从类复制的说明:Reader
根据字段读取字段对应的DeMember
-
readBoolean
public boolean readBoolean()
从类复制的说明:Reader
读取一个boolean值- 指定者:
readBoolean
在类中Reader
- 返回:
- boolean值
-
readBools
public final boolean[] readBools()
-
readBools
public final Collection<Boolean> readBools(Creator<? extends Collection> creator)
-
readBytes
public final byte[] readBytes()
-
readBytes
public final Collection<Byte> readBytes(Creator<? extends Collection> creator)
-
readChars
public final char[] readChars()
-
readChars
public final Collection<Character> readChars(Creator<? extends Collection> creator)
-
readShort
public final short readShort()
从类复制的说明:Reader
读取一个short值
-
readShorts
public final short[] readShorts()
-
readShorts
public final Collection<Short> readShorts(Creator<? extends Collection> creator)
-
readInts
public final int[] readInts()
-
readInts
public final Collection<Integer> readInts(Creator<? extends Collection> creator)
-
readFloat
public final float readFloat()
从类复制的说明:Reader
读取一个float值
-
readFloats
public final float[] readFloats()
-
readFloats
public final Collection<Float> readFloats(Creator<? extends Collection> creator)
-
readLongs
public final long[] readLongs()
-
readLongs
public final Collection<Long> readLongs(Creator<? extends Collection> creator)
-
readStrings
public final String[] readStrings(int tag)
-
readStrings
public final Collection<String> readStrings(int tag, Creator<? extends Collection> creator)
-
readDouble
public final double readDouble()
从类复制的说明:Reader
读取一个double值- 指定者:
readDouble
在类中Reader
- 返回:
- double值
-
readDoubles
public final double[] readDoubles()
-
readDoubles
public final Collection<Double> readDoubles(Creator<? extends Collection> creator)
-
readStandardString
public final String readStandardString()
从类复制的说明:Reader
读取无转义字符长度不超过255的字符串, 例如枚举值、字段名、类名字符串等- 指定者:
readStandardString
在类中Reader
- 返回:
- String值
-
readString
public String readString()
从类复制的说明:Reader
读取一个String值- 指定者:
readString
在类中Reader
- 返回:
- String值
-
readNextTag
public final boolean readNextTag(DeMember member)
-
readNextTag
public final boolean readNextTag(int memberTag)
-
readTag
protected final int readTag()
-
backTag
protected final void backTag(int tag)
-
readType
public final Reader.ValueType readType()
从类复制的说明:Reader
读取下个值的类型
-
hasNext
public boolean hasNext()
从类复制的说明:Reader
是否还存在下个元素或字段
-
readByteArray
public byte[] readByteArray()
从类复制的说明:Reader
读取byte[]- 指定者:
readByteArray
在类中Reader
- 返回:
- byte[]
-
remainBytes
public byte[] remainBytes()
-
readRawVarint32
protected int readRawVarint32()
-
readRawVarint64
protected long readRawVarint64()
-
readRawVarint64SlowPath
protected long readRawVarint64SlowPath()
-
readRawLittleEndian32
protected int readRawLittleEndian32()
-
readRawLittleEndian64
protected long readRawLittleEndian64()
-
-