Package io.protostuff
Interface Input
- All Known Subinterfaces:
GraphInput
- All Known Implementing Classes:
ByteArrayInput
,ByteBufferInput
,CodedInput
,FilterInput
,GraphByteArrayInput
,GraphCodedInput
,JsonInput
,KvpByteArrayInput
,KvpInput
,XmlInput
public interface Input
An Input lets an application read primitive data types and objects from a source of data.
-
Method Summary
Modifier and TypeMethodDescription<T> void
handleUnknownField
(int fieldNumber, Schema<T> schema) The underlying implementation should handle the unknown field.<T> T
mergeObject
(T value, Schema<T> schema) Merges an object(with schema) field value.boolean
readBool()
Reads a boolean field value.byte[]
Reads a byte array field value.Reads aByteString
field value.void
readBytes
(ByteBuffer bb) Reads a field value into aByteBuffer
.double
Reads a double field value.int
readEnum()
Reads an enum(its number) field value.<T> int
readFieldNumber
(Schema<T> schema) Reads the field number of a message/object tied to the givenschema
.int
Reads a fixed int(4 bytes) field value.long
Reads a fixed long(8 bytes) field value.float
Reads a float field value.int
Reads a variable int field value.long
Reads a variable long field value.int
Reads a signed+fixed int(4 bytes) field value.long
Reads a signed+fixed long(8 bytes) field value.int
Reads a signed int field value.long
Reads a signed long field value.Reads aString
field value.int
Reads an unsigned int field value.long
Reads an unsigned long field value.void
transferByteRangeTo
(Output output, boolean utf8String, int fieldNumber, boolean repeated) Transfer the byte range to the output.
-
Method Details
-
handleUnknownField
The underlying implementation should handle the unknown field.- Throws:
IOException
-
readFieldNumber
Reads the field number of a message/object tied to the givenschema
.- Throws:
IOException
-
readInt32
Reads a variable int field value.- Throws:
IOException
-
readUInt32
Reads an unsigned int field value.- Throws:
IOException
-
readSInt32
Reads a signed int field value.- Throws:
IOException
-
readFixed32
Reads a fixed int(4 bytes) field value.- Throws:
IOException
-
readSFixed32
Reads a signed+fixed int(4 bytes) field value.- Throws:
IOException
-
readInt64
Reads a variable long field value.- Throws:
IOException
-
readUInt64
Reads an unsigned long field value.- Throws:
IOException
-
readSInt64
Reads a signed long field value.- Throws:
IOException
-
readFixed64
Reads a fixed long(8 bytes) field value.- Throws:
IOException
-
readSFixed64
Reads a signed+fixed long(8 bytes) field value.- Throws:
IOException
-
readFloat
Reads a float field value.- Throws:
IOException
-
readDouble
Reads a double field value.- Throws:
IOException
-
readBool
Reads a boolean field value.- Throws:
IOException
-
readEnum
Reads an enum(its number) field value.- Throws:
IOException
-
readString
Reads aString
field value.- Throws:
IOException
-
readBytes
Reads aByteString
field value.- Throws:
IOException
-
readBytes
Reads a field value into aByteBuffer
.- Throws:
IOException
-
readByteArray
Reads a byte array field value.- Throws:
IOException
-
readByteBuffer
- Throws:
IOException
-
mergeObject
Merges an object(with schema) field value. The providedschema
handles the deserialization for the object.- Throws:
IOException
-
transferByteRangeTo
void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException Transfer the byte range to the output. Capable of zero-copy transfer depending on the type of input.- Throws:
IOException
-