public final class ProtoStreamReaderImpl extends Object implements MessageMarshaller.ProtoStreamReader
Constructor and Description |
---|
ProtoStreamReaderImpl(SerializationContext ctx) |
Modifier and Type | Method and Description |
---|---|
<A> A |
read(com.google.protobuf.CodedInputStream in,
Class<A> clazz) |
<A> A |
read(com.google.protobuf.CodedInputStream in,
MessageMarshaller<A> marshaller) |
<A> A[] |
readArray(String fieldName,
Class<? extends A> clazz) |
Boolean |
readBoolean(String fieldName) |
byte[] |
readBytes(String fieldName) |
<A,C extends Collection<? super A>> |
readCollection(String fieldName,
C collection,
Class<? extends A> clazz) |
Double |
readDouble(String fieldName) |
Float |
readFloat(String fieldName) |
Integer |
readInt(String fieldName)
Can't return an
int here because the field might be declared optional and missing so we might need to
return a null . |
Long |
readLong(String fieldName) |
<A> A |
readObject(String fieldName,
Class<? extends A> clazz) |
String |
readString(String fieldName) |
public ProtoStreamReaderImpl(SerializationContext ctx)
public <A> A read(com.google.protobuf.CodedInputStream in, Class<A> clazz) throws IOException
IOException
public <A> A read(com.google.protobuf.CodedInputStream in, MessageMarshaller<A> marshaller) throws IOException
IOException
public Integer readInt(String fieldName) throws IOException
MessageMarshaller.ProtoStreamReader
int
here because the field might be declared optional and missing so we might need to
return a null
.readInt
in interface MessageMarshaller.ProtoStreamReader
IOException
public Long readLong(String fieldName) throws IOException
readLong
in interface MessageMarshaller.ProtoStreamReader
IOException
public Float readFloat(String fieldName) throws IOException
readFloat
in interface MessageMarshaller.ProtoStreamReader
IOException
public Double readDouble(String fieldName) throws IOException
readDouble
in interface MessageMarshaller.ProtoStreamReader
IOException
public Boolean readBoolean(String fieldName) throws IOException
readBoolean
in interface MessageMarshaller.ProtoStreamReader
IOException
public String readString(String fieldName) throws IOException
readString
in interface MessageMarshaller.ProtoStreamReader
IOException
public byte[] readBytes(String fieldName) throws IOException
readBytes
in interface MessageMarshaller.ProtoStreamReader
IOException
public <A> A readObject(String fieldName, Class<? extends A> clazz) throws IOException
readObject
in interface MessageMarshaller.ProtoStreamReader
IOException
public <A,C extends Collection<? super A>> C readCollection(String fieldName, C collection, Class<? extends A> clazz) throws IOException
readCollection
in interface MessageMarshaller.ProtoStreamReader
IOException
public <A> A[] readArray(String fieldName, Class<? extends A> clazz) throws IOException
readArray
in interface MessageMarshaller.ProtoStreamReader
IOException
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.