Top Description Fields Constructors Methods
com.google.protobuf.nano

public final Class WireFormatNano

extends Object
Class Inheritance
Imports
java.io.IOException

This class is used internally by the Protocol Buffer library and generated message implementations. It is public only because those generated messages do not reside in the protobuf package. Others should not use this class directly. This class contains constants and helper functions useful for dealing with the Protocol Buffer wire format.
Author
[email protected] Kenton Varda

Field Summary

Modifier and TypeField and Description
public static final boolean[]
public static final byte[]
public static final byte[][]
public static final double[]
public static final float[]
public static final int[]
public static final long[]
public static final String[]
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static final int

Returns:

length of array
getRepeatedFieldArrayLength
(final CodedInputByteBufferNano
stream input, pointing to the byte after the first tag
input
,
final int
repeated field tag just read
tag
)

Computes the array length of a repeated field.

public static int
getTagFieldNumber(final int tag)

Given a tag value, determines the field number (the upper 29 bits).

pack-priv static int
getTagWireType(final int tag)

Given a tag value, determines the wire type (the lower 3 bits).

pack-priv static int
makeTag(final int fieldNumber, final int wireType)

Makes a tag value given a field number and wire type.

public static boolean

Returns:

true unless the tag is an end-group tag.
parseUnknownField
(final CodedInputByteBufferNano input, final int tag)

Parses an unknown field.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_BOOLEAN_ARRAYback to summary
public static final boolean[] EMPTY_BOOLEAN_ARRAY
EMPTY_BYTESback to summary
public static final byte[] EMPTY_BYTES
EMPTY_BYTES_ARRAYback to summary
public static final byte[][] EMPTY_BYTES_ARRAY
EMPTY_DOUBLE_ARRAYback to summary
public static final double[] EMPTY_DOUBLE_ARRAY
EMPTY_FLOAT_ARRAYback to summary
public static final float[] EMPTY_FLOAT_ARRAY
EMPTY_INT_ARRAYback to summary
public static final int[] EMPTY_INT_ARRAY
EMPTY_LONG_ARRAYback to summary
public static final long[] EMPTY_LONG_ARRAY
EMPTY_STRING_ARRAYback to summary
public static final String[] EMPTY_STRING_ARRAY
TAG_TYPE_BITSback to summary
pack-priv static final int TAG_TYPE_BITS
TAG_TYPE_MASKback to summary
pack-priv static final int TAG_TYPE_MASK
WIRETYPE_END_GROUPback to summary
pack-priv static final int WIRETYPE_END_GROUP
WIRETYPE_FIXED32back to summary
pack-priv static final int WIRETYPE_FIXED32
WIRETYPE_FIXED64back to summary
pack-priv static final int WIRETYPE_FIXED64
WIRETYPE_LENGTH_DELIMITEDback to summary
pack-priv static final int WIRETYPE_LENGTH_DELIMITED
WIRETYPE_START_GROUPback to summary
pack-priv static final int WIRETYPE_START_GROUP
WIRETYPE_VARINTback to summary
pack-priv static final int WIRETYPE_VARINT

Constructor Detail

WireFormatNanoback to summary
private WireFormatNano()

Method Detail

getRepeatedFieldArrayLengthback to summary
public static final int getRepeatedFieldArrayLength(final CodedInputByteBufferNano input, final int tag) throws IOException

Computes the array length of a repeated field. We assume that in the common case repeated fields are contiguously serialized but we still correctly handle interspersed values of a repeated field (but with extra allocations). Rewinds to current input position before returning.

Parameters
input:CodedInputByteBufferNano

stream input, pointing to the byte after the first tag

tag:int

repeated field tag just read

Returns:int

length of array

getTagFieldNumberback to summary
public static int getTagFieldNumber(final int tag)

Given a tag value, determines the field number (the upper 29 bits).

getTagWireTypeback to summary
pack-priv static int getTagWireType(final int tag)

Given a tag value, determines the wire type (the lower 3 bits).

makeTagback to summary
pack-priv static int makeTag(final int fieldNumber, final int wireType)

Makes a tag value given a field number and wire type.

parseUnknownFieldback to summary
public static boolean parseUnknownField(final CodedInputByteBufferNano input, final int tag) throws IOException

Parses an unknown field. This implementation skips the field.

Generated messages will call this for unknown fields if the store_unknown_fields option is off.

Returns:boolean

true unless the tag is an end-group tag.