public final class ByteArrayInputEx extends Object implements InputEx
IOUtil where it catches
ArrayIndexOutOfBoundsException when a message is truncated.| Constructor and Description |
|---|
ByteArrayInputEx(byte[] buffer) |
ByteArrayInputEx(byte[] buffer,
int offset,
int len) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkLastTagWas(int value)
Verifies that the last call to readTag() returned the given tag value.
|
com.fasterxml.jackson.databind.util.ArrayBuilders |
getArrayBuilders() |
void |
handleUnknownField(int fieldNumber)
The underlying implementation should handle the unknown field.
|
boolean |
isCurrentFieldPacked()
Return true if currently reading packed field
|
<T> T |
mergeObject(T value,
SchemaReader<T> schema)
Merges an object(with schema) field value.
|
boolean |
readBool()
Read a
bool field value from the internal buffer. |
byte[] |
readByteArray()
Reads a byte array field value.
|
ByteBuffer |
readByteBuffer()
Reads a byte array/ByteBuffer value.
|
io.protostuff.ByteString |
readBytes()
Reads a
ByteString field value. |
double |
readDouble()
Read a
double field value from the internal buffer. |
int |
readEnum()
Read an enum field value from the internal buffer.
|
int |
readFieldNumber()
Reads field number.
|
int |
readFixed32()
Read a
fixed32 field value from the internal buffer. |
long |
readFixed64()
Read a
fixed64 field value from the internal buffer. |
float |
readFloat()
Read a
float field value from the internal buffer. |
int |
readInt32()
Read an
int32 field value from the internal buffer. |
long |
readInt64()
Read an
int64 field value from the internal buffer. |
boolean |
readPackedBool() |
double |
readPackedDouble() |
int |
readPackedEnum() |
int |
readPackedFixed32() |
long |
readPackedFixed64() |
float |
readPackedFloat() |
int |
readPackedInt32() |
long |
readPackedInt64() |
int |
readPackedSFixed32() |
long |
readPackedSFixed64() |
int |
readPackedSInt32() |
long |
readPackedSInt64() |
int |
readPackedUInt32() |
long |
readPackedUInt64() |
int |
readRawLittleEndian32()
Read a 32-bit little-endian integer from the internal buffer.
|
long |
readRawLittleEndian64()
Read a 64-bit little-endian integer from the internal byte buffer.
|
int |
readRawVarint32()
Reads a var int 32 from the internal byte buffer.
|
long |
readRawVarint64()
Reads a var int 64 from the internal byte buffer.
|
int |
readSFixed32()
Read an
sfixed32 field value from the internal buffer. |
long |
readSFixed64()
Read an
sfixed64 field value from the internal buffer. |
int |
readSInt32()
Read an
sint32 field value from the internal buffer. |
long |
readSInt64()
Read an
sint64 field value from the internal buffer. |
String |
readString()
Reads a
String field value. |
int |
readTag()
Attempt to read a field tag, returning zero if we have reached EOF.
|
int |
readUInt32()
Read a
uint32 field value from the internal buffer. |
long |
readUInt64()
Read a
uint64 field value from the internal buffer. |
boolean |
skipField(int tag)
Reads and discards a single field, given its tag value.
|
void |
skipMessage()
Reads and discards an entire message.
|
public ByteArrayInputEx(byte[] buffer)
public ByteArrayInputEx(byte[] buffer,
int offset,
int len)
public boolean isCurrentFieldPacked()
public int readTag()
throws IOException
IOExceptionpublic void checkLastTagWas(int value)
throws io.protostuff.ProtobufException
ProtobufException - value does not match the last tag.public boolean skipField(int tag)
throws IOException
false if the tag is an endgroup tag, in which case nothing is skipped. Otherwise, returns
true.IOExceptionpublic void skipMessage()
throws IOException
IOExceptionpublic void handleUnknownField(int fieldNumber)
throws IOException
InputExhandleUnknownField in interface InputExIOExceptionpublic int readFieldNumber()
throws IOException
InputExreadFieldNumber in interface InputExIOExceptionpublic double readDouble()
double field value from the internal buffer.readDouble in interface InputExpublic float readFloat()
float field value from the internal buffer.public long readUInt64()
throws IOException
uint64 field value from the internal buffer.readUInt64 in interface InputExIOExceptionpublic long readInt64()
throws IOException
int64 field value from the internal buffer.readInt64 in interface InputExIOExceptionpublic int readInt32()
throws IOException
int32 field value from the internal buffer.readInt32 in interface InputExIOExceptionpublic long readFixed64()
fixed64 field value from the internal buffer.readFixed64 in interface InputExpublic int readFixed32()
fixed32 field value from the internal buffer.readFixed32 in interface InputExpublic boolean readBool()
bool field value from the internal buffer.public int readUInt32()
throws IOException
uint32 field value from the internal buffer.readUInt32 in interface InputExIOExceptionpublic int readEnum()
throws IOException
readEnum in interface InputExIOExceptionpublic int readSFixed32()
sfixed32 field value from the internal buffer.readSFixed32 in interface InputExpublic long readSFixed64()
sfixed64 field value from the internal buffer.readSFixed64 in interface InputExpublic int readSInt32()
throws IOException
sint32 field value from the internal buffer.readSInt32 in interface InputExIOExceptionpublic long readSInt64()
throws IOException
sint64 field value from the internal buffer.readSInt64 in interface InputExIOExceptionpublic String readString() throws IOException
InputExString field value.readString in interface InputExIOExceptionpublic io.protostuff.ByteString readBytes()
throws IOException
InputExByteString field value.readBytes in interface InputExIOExceptionpublic byte[] readByteArray()
throws IOException
InputExreadByteArray in interface InputExIOExceptionpublic <T> T mergeObject(T value,
SchemaReader<T> schema)
throws IOException
InputExschema handles the deserialization for the
object.mergeObject in interface InputExIOExceptionpublic int readRawVarint32()
throws IOException
IOExceptionpublic long readRawVarint64()
throws IOException
IOExceptionpublic int readRawLittleEndian32()
public long readRawLittleEndian64()
public ByteBuffer readByteBuffer() throws IOException
readByteBuffer in interface InputExIOExceptionpublic com.fasterxml.jackson.databind.util.ArrayBuilders getArrayBuilders()
getArrayBuilders in interface InputExpublic int readPackedInt32()
throws IOException
readPackedInt32 in interface InputExIOExceptionpublic int readPackedUInt32()
throws IOException
readPackedUInt32 in interface InputExIOExceptionpublic int readPackedSInt32()
throws IOException
readPackedSInt32 in interface InputExIOExceptionpublic int readPackedFixed32()
throws IOException
readPackedFixed32 in interface InputExIOExceptionpublic int readPackedSFixed32()
throws IOException
readPackedSFixed32 in interface InputExIOExceptionpublic long readPackedInt64()
throws IOException
readPackedInt64 in interface InputExIOExceptionpublic long readPackedUInt64()
throws IOException
readPackedUInt64 in interface InputExIOExceptionpublic long readPackedSInt64()
throws IOException
readPackedSInt64 in interface InputExIOExceptionpublic long readPackedFixed64()
throws IOException
readPackedFixed64 in interface InputExIOExceptionpublic long readPackedSFixed64()
throws IOException
readPackedSFixed64 in interface InputExIOExceptionpublic float readPackedFloat()
throws IOException
readPackedFloat in interface InputExIOExceptionpublic double readPackedDouble()
throws IOException
readPackedDouble in interface InputExIOExceptionpublic boolean readPackedBool()
throws IOException
readPackedBool in interface InputExIOExceptionpublic int readPackedEnum()
throws IOException
readPackedEnum in interface InputExIOExceptionCopyright © 2017–2019 The Apache Software Foundation. All rights reserved.