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> voidhandleUnknownField(int fieldNumber, Schema<T> schema) The underlying implementation should handle the unknown field.<T> TmergeObject(T value, Schema<T> schema) Merges an object(with schema) field value.booleanreadBool()Reads a boolean field value.byte[]Reads a byte array field value.Reads aByteStringfield value.voidreadBytes(ByteBuffer bb) Reads a field value into aByteBuffer.doubleReads a double field value.intreadEnum()Reads an enum(its number) field value.<T> intreadFieldNumber(Schema<T> schema) Reads the field number of a message/object tied to the givenschema.intReads a fixed int(4 bytes) field value.longReads a fixed long(8 bytes) field value.floatReads a float field value.intReads a variable int field value.longReads a variable long field value.intReads a signed+fixed int(4 bytes) field value.longReads a signed+fixed long(8 bytes) field value.intReads a signed int field value.longReads a signed long field value.Reads aStringfield value.intReads an unsigned int field value.longReads an unsigned long field value.voidtransferByteRangeTo(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 aStringfield value.- Throws:
IOException
-
readBytes
Reads aByteStringfield 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 providedschemahandles 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
-