public class GenericProtobufJsonObjectInput extends Object implements ObjectInput
| Constructor and Description |
|---|
GenericProtobufJsonObjectInput(InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
readAttachments()
FIXME, only supports transmission of String values.
|
boolean |
readBool()
Read boolean.
|
byte |
readByte()
Read byte.
|
byte[] |
readBytes()
Read byte array.
|
double |
readDouble()
Read double.
|
Object |
readEvent() |
float |
readFloat()
Read float.
|
int |
readInt()
Read integer.
|
long |
readLong()
Read long.
|
Object |
readObject()
Consider use
ObjectInput.readObject(Class) or ObjectInput.readObject(Class, Type) where possible |
<T> T |
readObject(Class<T> cls)
read object
|
<T> T |
readObject(Class<T> cls,
Type type)
read object
|
short |
readShort()
Read short integer.
|
Throwable |
readThrowable()
The following methods are customized for the requirement of Dubbo's RPC protocol implementation.
|
String |
readUTF()
Read UTF-8 string.
|
public GenericProtobufJsonObjectInput(InputStream in)
public boolean readBool()
throws IOException
DataInputreadBool in interface DataInputIOExceptionpublic byte readByte()
throws IOException
DataInputreadByte in interface DataInputIOExceptionpublic short readShort()
throws IOException
DataInputreadShort in interface DataInputIOExceptionpublic int readInt()
throws IOException
DataInputreadInt in interface DataInputIOExceptionpublic long readLong()
throws IOException
DataInputreadLong in interface DataInputIOExceptionpublic float readFloat()
throws IOException
DataInputreadFloat in interface DataInputIOExceptionpublic double readDouble()
throws IOException
DataInputreadDouble in interface DataInputIOExceptionpublic String readUTF() throws IOException
DataInputreadUTF in interface DataInputIOExceptionpublic byte[] readBytes()
throws IOException
DataInputreadBytes in interface DataInputIOExceptionpublic Object readObject()
ObjectInputObjectInput.readObject(Class) or ObjectInput.readObject(Class, Type) where possiblereadObject in interface ObjectInputpublic <T> T readObject(Class<T> cls) throws IOException
ObjectInputreadObject in interface ObjectInputcls - object classIOException - if an I/O error occurspublic <T> T readObject(Class<T> cls, Type type) throws IOException
ObjectInputreadObject in interface ObjectInputcls - object classtype - object typeIOException - if an I/O error occurspublic Throwable readThrowable() throws IOException
ObjectInputSee how ProtobufSerialization, KryoSerialization implemented these methods for more details.
The binding of RPC protocol and biz serialization protocol is not a good practice. Encoding of RPC protocol should be highly independent and portable, easy to cross platforms and languages, for example, like the http headers, restricting the content of headers / attachments to Ascii strings and uses ISO_8859_1 to encode them. https://tools.ietf.org/html/rfc7540#section-8.1.2
readThrowable in interface ObjectInputIOExceptionpublic Map<String,Object> readAttachments() throws IOException, ClassNotFoundException
readAttachments in interface ObjectInputIOExceptionClassNotFoundExceptionpublic Object readEvent() throws IOException, ClassNotFoundException
readEvent in interface ObjectInputIOExceptionClassNotFoundExceptionCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.