Package io.protostuff
Class XmlInput
java.lang.Object
io.protostuff.XmlInput
- All Implemented Interfaces:
Input
An input used for reading data with xml format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]
private boolean
private final XMLStreamReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate byte[]
private String
getText()
<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.private int
next()
private int
nextTag()
boolean
readBool()
Reads a boolean field value.byte[]
Reads a byte array field value.Reads a byte array/ByteBuffer 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.
-
Field Details
-
EMPTY
private static final byte[] EMPTY -
parser
-
emptyMessage
private boolean emptyMessage
-
-
Constructor Details
-
XmlInput
-
-
Method Details
-
next
- Throws:
IOException
-
nextTag
- Throws:
IOException
-
getB64Decoded
- Throws:
IOException
-
getText
- Throws:
IOException
-
handleUnknownField
Description copied from interface:Input
The underlying implementation should handle the unknown field.- Specified by:
handleUnknownField
in interfaceInput
- Throws:
IOException
-
readFieldNumber
Description copied from interface:Input
Reads the field number of a message/object tied to the givenschema
.- Specified by:
readFieldNumber
in interfaceInput
- Throws:
IOException
-
readInt32
Description copied from interface:Input
Reads a variable int field value.- Specified by:
readInt32
in interfaceInput
- Throws:
IOException
-
readUInt32
Description copied from interface:Input
Reads an unsigned int field value.- Specified by:
readUInt32
in interfaceInput
- Throws:
IOException
-
readSInt32
Description copied from interface:Input
Reads a signed int field value.- Specified by:
readSInt32
in interfaceInput
- Throws:
IOException
-
readFixed32
Description copied from interface:Input
Reads a fixed int(4 bytes) field value.- Specified by:
readFixed32
in interfaceInput
- Throws:
IOException
-
readSFixed32
Description copied from interface:Input
Reads a signed+fixed int(4 bytes) field value.- Specified by:
readSFixed32
in interfaceInput
- Throws:
IOException
-
readInt64
Description copied from interface:Input
Reads a variable long field value.- Specified by:
readInt64
in interfaceInput
- Throws:
IOException
-
readUInt64
Description copied from interface:Input
Reads an unsigned long field value.- Specified by:
readUInt64
in interfaceInput
- Throws:
IOException
-
readSInt64
Description copied from interface:Input
Reads a signed long field value.- Specified by:
readSInt64
in interfaceInput
- Throws:
IOException
-
readFixed64
Description copied from interface:Input
Reads a fixed long(8 bytes) field value.- Specified by:
readFixed64
in interfaceInput
- Throws:
IOException
-
readSFixed64
Description copied from interface:Input
Reads a signed+fixed long(8 bytes) field value.- Specified by:
readSFixed64
in interfaceInput
- Throws:
IOException
-
readFloat
Description copied from interface:Input
Reads a float field value.- Specified by:
readFloat
in interfaceInput
- Throws:
IOException
-
readDouble
Description copied from interface:Input
Reads a double field value.- Specified by:
readDouble
in interfaceInput
- Throws:
IOException
-
readBool
Description copied from interface:Input
Reads a boolean field value.- Specified by:
readBool
in interfaceInput
- Throws:
IOException
-
readEnum
Description copied from interface:Input
Reads an enum(its number) field value.- Specified by:
readEnum
in interfaceInput
- Throws:
IOException
-
readString
Description copied from interface:Input
Reads aString
field value.- Specified by:
readString
in interfaceInput
- Throws:
IOException
-
readBytes
Description copied from interface:Input
Reads aByteString
field value.- Specified by:
readBytes
in interfaceInput
- Throws:
IOException
-
readByteArray
Description copied from interface:Input
Reads a byte array field value.- Specified by:
readByteArray
in interfaceInput
- Throws:
IOException
-
mergeObject
Description copied from interface:Input
Merges an object(with schema) field value. The providedschema
handles the deserialization for the object.- Specified by:
mergeObject
in interfaceInput
- Throws:
IOException
-
transferByteRangeTo
public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException Description copied from interface:Input
Transfer the byte range to the output. Capable of zero-copy transfer depending on the type of input.- Specified by:
transferByteRangeTo
in interfaceInput
- Throws:
IOException
-
readByteBuffer
Reads a byte array/ByteBuffer value.- Specified by:
readByteBuffer
in interfaceInput
- Throws:
IOException
-
readBytes
Description copied from interface:Input
Reads a field value into aByteBuffer
.- Specified by:
readBytes
in interfaceInput
- Throws:
IOException
-