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 InputAn Input lets an application read primitive data types and objects from a source of data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <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[]readByteArray()Reads a byte array field value.java.nio.ByteBufferreadByteBuffer()ByteStringreadBytes()Reads aByteStringfield value.voidreadBytes(java.nio.ByteBuffer bb)Reads a field value into aByteBuffer.doublereadDouble()Reads 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.intreadFixed32()Reads a fixed int(4 bytes) field value.longreadFixed64()Reads a fixed long(8 bytes) field value.floatreadFloat()Reads a float field value.intreadInt32()Reads a variable int field value.longreadInt64()Reads a variable long field value.intreadSFixed32()Reads a signed+fixed int(4 bytes) field value.longreadSFixed64()Reads a signed+fixed long(8 bytes) field value.intreadSInt32()Reads a signed int field value.longreadSInt64()Reads a signed long field value.java.lang.StringreadString()Reads aStringfield value.intreadUInt32()Reads an unsigned int field value.longreadUInt64()Reads an unsigned long field value.voidtransferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated)Transfer the byte range to the output.
-
-
-
Method Detail
-
handleUnknownField
<T> void handleUnknownField(int fieldNumber, Schema<T> schema) throws java.io.IOExceptionThe underlying implementation should handle the unknown field.- Throws:
java.io.IOException
-
readFieldNumber
<T> int readFieldNumber(Schema<T> schema) throws java.io.IOException
Reads the field number of a message/object tied to the givenschema.- Throws:
java.io.IOException
-
readInt32
int readInt32() throws java.io.IOExceptionReads a variable int field value.- Throws:
java.io.IOException
-
readUInt32
int readUInt32() throws java.io.IOExceptionReads an unsigned int field value.- Throws:
java.io.IOException
-
readSInt32
int readSInt32() throws java.io.IOExceptionReads a signed int field value.- Throws:
java.io.IOException
-
readFixed32
int readFixed32() throws java.io.IOExceptionReads a fixed int(4 bytes) field value.- Throws:
java.io.IOException
-
readSFixed32
int readSFixed32() throws java.io.IOExceptionReads a signed+fixed int(4 bytes) field value.- Throws:
java.io.IOException
-
readInt64
long readInt64() throws java.io.IOExceptionReads a variable long field value.- Throws:
java.io.IOException
-
readUInt64
long readUInt64() throws java.io.IOExceptionReads an unsigned long field value.- Throws:
java.io.IOException
-
readSInt64
long readSInt64() throws java.io.IOExceptionReads a signed long field value.- Throws:
java.io.IOException
-
readFixed64
long readFixed64() throws java.io.IOExceptionReads a fixed long(8 bytes) field value.- Throws:
java.io.IOException
-
readSFixed64
long readSFixed64() throws java.io.IOExceptionReads a signed+fixed long(8 bytes) field value.- Throws:
java.io.IOException
-
readFloat
float readFloat() throws java.io.IOExceptionReads a float field value.- Throws:
java.io.IOException
-
readDouble
double readDouble() throws java.io.IOExceptionReads a double field value.- Throws:
java.io.IOException
-
readBool
boolean readBool() throws java.io.IOExceptionReads a boolean field value.- Throws:
java.io.IOException
-
readEnum
int readEnum() throws java.io.IOExceptionReads an enum(its number) field value.- Throws:
java.io.IOException
-
readString
java.lang.String readString() throws java.io.IOExceptionReads aStringfield value.- Throws:
java.io.IOException
-
readBytes
ByteString readBytes() throws java.io.IOException
Reads aByteStringfield value.- Throws:
java.io.IOException
-
readBytes
void readBytes(java.nio.ByteBuffer bb) throws java.io.IOExceptionReads a field value into aByteBuffer.- Throws:
java.io.IOException
-
readByteArray
byte[] readByteArray() throws java.io.IOExceptionReads a byte array field value.- Throws:
java.io.IOException
-
readByteBuffer
java.nio.ByteBuffer readByteBuffer() throws java.io.IOException- Throws:
java.io.IOException
-
mergeObject
<T> T mergeObject(T value, Schema<T> schema) throws java.io.IOExceptionMerges an object(with schema) field value. The providedschemahandles the deserialization for the object.- Throws:
java.io.IOException
-
transferByteRangeTo
void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws java.io.IOException
Transfer the byte range to the output. Capable of zero-copy transfer depending on the type of input.- Throws:
java.io.IOException
-
-