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
-
readUInt32
-
readSInt32
-
readFixed32
-
readSFixed32
Reads a signed+fixed int(4 bytes) field value.- Throws:
IOException
-
readInt64
-
readUInt64
-
readSInt64
-
readFixed64
-
readSFixed64
Reads a signed+fixed long(8 bytes) field value.- Throws:
IOException
-
readFloat
-
readDouble
-
readBool
-
readEnum
-
readString
-
readBytes
-
readBytes
Reads a field value into aByteBuffer.- Throws:
IOException
-
readByteArray
-
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
-