- 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 IntegercacheTagprotected intlimitprotected static CreatorLIS_CREATORprotected intposition-
从类继承的字段 org.redkale.convert.Reader
SIGN_NULL, SIGN_VARIABLE
-
-
构造器概要
构造器 构造器 说明 ProtobufReader()ProtobufReader(byte[] bytes)ProtobufReader(byte[] bytes, int start, int len)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voidbackTag(int tag)ProtobufReaderclear()booleanhasNext()是否还存在下个元素或字段intlimit()voidlimit(int limit)intposition()获取当前位置voidprepare(byte[] bytes)设置Reader的内容,通常结合对象池使用intreadArrayB(Decodeable componentDecoder)判断下一个非空白字符是否为[voidreadArrayE()读取数组的尾端voidreadBlank()判断下一个非空白字节是否:booleanreadBoolean()读取一个boolean值boolean[]readBools()Collection<Boolean>readBools(Creator<? extends Collection> creator)bytereadByte()读取一个byte值byte[]readByteArray()读取byte[]byte[]readBytes()Collection<Byte>readBytes(Creator<? extends Collection> creator)charreadChar()读取一个char值char[]readChars()Collection<Character>readChars(Creator<? extends Collection> creator)doublereadDouble()读取一个double值double[]readDoubles()Collection<Double>readDoubles(Creator<? extends Collection> creator)DeMemberreadField(DeMemberInfo memberInfo)根据字段读取字段对应的DeMemberfloatreadFloat()读取一个float值float[]readFloats()Collection<Float>readFloats(Creator<? extends Collection> creator)intreadInt()读取一个int值int[]readInts()Collection<Integer>readInts(Creator<? extends Collection> creator)longreadLong()读取一个long值long[]readLongs()Collection<Long>readLongs(Creator<? extends Collection> creator)intreadMapB(Decodeable keyDecoder, Decodeable valueDecoder)读取map的开头并返回map的sizevoidreadMapE()读取数组的尾端booleanreadNextTag(int memberTag)booleanreadNextTag(DeMember member)StringreadObjectB(Class clazz)读取对象的类名, 返回 null 表示对象为null, 返回空字符串表示当前class与返回的class一致,返回非空字符串表示class是当前class的子类。voidreadObjectE(Class clazz)读取对象的尾端protected intreadRawLittleEndian32()protected longreadRawLittleEndian64()protected intreadRawVarint32()protected longreadRawVarint64()protected longreadRawVarint64SlowPath()shortreadShort()读取一个short值short[]readShorts()Collection<Short>readShorts(Creator<? extends Collection> creator)StringreadStandardString()读取无转义字符长度不超过255的字符串, 例如枚举值、字段名、类名字符串等StringreadString()读取一个String值String[]readStrings(int tag)Collection<String>readStrings(int tag, Creator<? extends Collection> creator)protected intreadTag()Reader.ValueTypereadType()读取下个值的类型protected booleanrecycle()byte[]remainBytes()ProtobufReadersetBytes(byte[] bytes)ProtobufReadersetBytes(byte[] bytes, int start, int len)voidskipValue()跳过属性的值
-
-
-
方法详细资料
-
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()
-
-