ProtobufOutputStreamOutput
Modified Protocol Buffers Output
The main difference between his and the stock Protocol Buffers Implementation is the handling of repeated fields. In this implementation:
- We use ONLY packed repeated fields for collections (including non-numeric types)
The Stock Implementation:
- Optionally uses packed repeated fields for numeric types
Attributes
- Graph
-
- Supertypes
-
trait Outputtrait RawOutputtrait NestedOutputtrait FieldOutputclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.)
Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.)
Value parameters
- n
-
A signed 32-bit integer.
Attributes
- Returns
-
An unsigned 32-bit integer, stored in a signed int because Java has no explicit unsigned support.
Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.)
Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.)
Value parameters
- n
-
A signed 64-bit integer.
Attributes
- Returns
-
An unsigned 64-bit integer, stored in a signed int because Java has no explicit unsigned support.
Note: This is a very inefficient way to encode null (it takes 10 bytes!!!) but it should be a very rare case since we have a separate encoding for null fields that will be used the majority of the time.
Note: This is a very inefficient way to encode null (it takes 10 bytes!!!) but it should be a very rare case since we have a separate encoding for null fields that will be used the majority of the time.
The only time this should get called is for null values within a collection or nested collection which is hopefully a rare case.
e.g. List("1","2",null,"4") or List(List("1","2"), List(null, null), List("5","6"))
Attributes
Write a big-endian 32-bit integer.
Write a big-endian 32-bit integer.
Attributes
Write a big-endian 64-bit integer.
Write a big-endian 64-bit integer.
Attributes
Write out a RAW collection. This method will wrap the collection in whatever leading/trailing "stuff" is needed (e.g. length prefixing, leading/trailing chars, etc...). The method that you pass in should use the Output instance to make repeated calls to a single write
Write out a RAW collection. This method will wrap the collection in whatever leading/trailing "stuff" is needed (e.g. length prefixing, leading/trailing chars, etc...). The method that you pass in should use the Output instance to make repeated calls to a single write
Attributes
Write a little-endian 32-bit integer.
Write a little-endian 32-bit integer.
Attributes
Write a little-endian 64-bit integer.
Write a little-endian 64-bit integer.
Attributes
For writing objects. Note: that the obj is passed in for null handling by the implementation. If the object is not null then the function f will be called so the caller can write out the fields
For writing objects. Note: that the obj is passed in for null handling by the implementation. If the object is not null then the function f will be called so the caller can write out the fields
Attributes
Encode and write a varint. value
is treated as unsigned, so it won't be sign-extended if negative.
Encode and write a varint. value
is treated as unsigned, so it won't be sign-extended if negative.
Attributes
Encode and write a varint.
Encode and write a varint.
Attributes
Encode and write a tag.
Encode and write a tag.