Package io.protostuff
Class XmlInput
- java.lang.Object
-
- io.protostuff.XmlInput
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]EMPTYprivate booleanemptyMessageprivate javax.xml.stream.XMLStreamReaderparser
-
Constructor Summary
Constructors Constructor Description XmlInput(javax.xml.stream.XMLStreamReader parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private byte[]getB64Decoded()private java.lang.StringgetText()<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.private intnext()private intnextTag()booleanreadBool()Reads a boolean field value.byte[]readByteArray()Reads a byte array field value.java.nio.ByteBufferreadByteBuffer()Reads a byte array/ByteBuffer value.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
-
next
private int next() throws java.io.IOException- Throws:
java.io.IOException
-
nextTag
private int nextTag() throws java.io.IOException- Throws:
java.io.IOException
-
getB64Decoded
private byte[] getB64Decoded() throws java.io.IOException- Throws:
java.io.IOException
-
getText
private java.lang.String getText() throws java.io.IOException- Throws:
java.io.IOException
-
handleUnknownField
public <T> void handleUnknownField(int fieldNumber, Schema<T> schema) throws java.io.IOExceptionDescription copied from interface:InputThe underlying implementation should handle the unknown field.- Specified by:
handleUnknownFieldin interfaceInput- Throws:
java.io.IOException
-
readFieldNumber
public <T> int readFieldNumber(Schema<T> schema) throws java.io.IOException
Description copied from interface:InputReads the field number of a message/object tied to the givenschema.- Specified by:
readFieldNumberin interfaceInput- Throws:
java.io.IOException
-
readInt32
public int readInt32() throws java.io.IOExceptionDescription copied from interface:InputReads a variable int field value.
-
readUInt32
public int readUInt32() throws java.io.IOExceptionDescription copied from interface:InputReads an unsigned int field value.- Specified by:
readUInt32in interfaceInput- Throws:
java.io.IOException
-
readSInt32
public int readSInt32() throws java.io.IOExceptionDescription copied from interface:InputReads a signed int field value.- Specified by:
readSInt32in interfaceInput- Throws:
java.io.IOException
-
readFixed32
public int readFixed32() throws java.io.IOExceptionDescription copied from interface:InputReads a fixed int(4 bytes) field value.- Specified by:
readFixed32in interfaceInput- Throws:
java.io.IOException
-
readSFixed32
public int readSFixed32() throws java.io.IOExceptionDescription copied from interface:InputReads a signed+fixed int(4 bytes) field value.- Specified by:
readSFixed32in interfaceInput- Throws:
java.io.IOException
-
readInt64
public long readInt64() throws java.io.IOExceptionDescription copied from interface:InputReads a variable long field value.
-
readUInt64
public long readUInt64() throws java.io.IOExceptionDescription copied from interface:InputReads an unsigned long field value.- Specified by:
readUInt64in interfaceInput- Throws:
java.io.IOException
-
readSInt64
public long readSInt64() throws java.io.IOExceptionDescription copied from interface:InputReads a signed long field value.- Specified by:
readSInt64in interfaceInput- Throws:
java.io.IOException
-
readFixed64
public long readFixed64() throws java.io.IOExceptionDescription copied from interface:InputReads a fixed long(8 bytes) field value.- Specified by:
readFixed64in interfaceInput- Throws:
java.io.IOException
-
readSFixed64
public long readSFixed64() throws java.io.IOExceptionDescription copied from interface:InputReads a signed+fixed long(8 bytes) field value.- Specified by:
readSFixed64in interfaceInput- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOExceptionDescription copied from interface:InputReads a float field value.
-
readDouble
public double readDouble() throws java.io.IOExceptionDescription copied from interface:InputReads a double field value.- Specified by:
readDoublein interfaceInput- Throws:
java.io.IOException
-
readBool
public boolean readBool() throws java.io.IOExceptionDescription copied from interface:InputReads a boolean field value.
-
readEnum
public int readEnum() throws java.io.IOExceptionDescription copied from interface:InputReads an enum(its number) field value.
-
readString
public java.lang.String readString() throws java.io.IOExceptionDescription copied from interface:InputReads aStringfield value.- Specified by:
readStringin interfaceInput- Throws:
java.io.IOException
-
readBytes
public ByteString readBytes() throws java.io.IOException
Description copied from interface:InputReads aByteStringfield value.
-
readByteArray
public byte[] readByteArray() throws java.io.IOExceptionDescription copied from interface:InputReads a byte array field value.- Specified by:
readByteArrayin interfaceInput- Throws:
java.io.IOException
-
mergeObject
public <T> T mergeObject(T value, Schema<T> schema) throws java.io.IOExceptionDescription copied from interface:InputMerges an object(with schema) field value. The providedschemahandles the deserialization for the object.- Specified by:
mergeObjectin interfaceInput- Throws:
java.io.IOException
-
transferByteRangeTo
public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws java.io.IOException
Description copied from interface:InputTransfer the byte range to the output. Capable of zero-copy transfer depending on the type of input.- Specified by:
transferByteRangeToin interfaceInput- Throws:
java.io.IOException
-
readByteBuffer
public java.nio.ByteBuffer readByteBuffer() throws java.io.IOExceptionReads a byte array/ByteBuffer value.- Specified by:
readByteBufferin interfaceInput- Throws:
java.io.IOException
-
-