ProtobufOutput

fm.serializer.protobuf.ProtobufOutput
final class ProtobufOutput() extends Output

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 Output
trait RawOutput
trait NestedOutput
trait FieldOutput
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def allowStringMap: Boolean
final def makeTag(fieldNumber: Int, wireType: Int): Int

Copied From WireType.makeTag

Copied From WireType.makeTag

Attributes

def reset(): Unit
def toByteArray: Array[Byte]
final def writeFieldBigDecimal(number: Int, name: String, value: BigDecimal): Unit
final def writeFieldBigInteger(number: Int, name: String, value: BigInteger): Unit
final def writeFieldBool(number: Int, name: String, value: Boolean): Unit
final def writeFieldByteArray(number: Int, name: String, value: Array[Byte]): Unit
final def writeFieldCollection[T](number: Int, name: String, col: T)(f: (NestedOutput, T) => Unit): Unit
final def writeFieldDouble(number: Int, name: String, value: Double): Unit
final def writeFieldFixedInt(number: Int, name: String, value: Int): Unit
final def writeFieldFixedLong(number: Int, name: String, value: Long): Unit
final def writeFieldFloat(number: Int, name: String, value: Float): Unit
final def writeFieldInt(number: Int, name: String, value: Int): Unit
final def writeFieldLong(number: Int, name: String, value: Long): Unit
final def writeFieldNull(number: Int, name: String): Unit
final def writeFieldObject[T](number: Int, name: String, obj: T)(f: (FieldOutput, T) => Unit): Unit
final def writeFieldSignedInt(number: Int, name: String, value: Int): Unit
final def writeFieldSignedLong(number: Int, name: String, value: Long): Unit
final def writeFieldString(number: Int, name: String, value: String): Unit
final def writeFieldUnsignedInt(number: Int, name: String, value: Int): Unit
final def writeFieldUnsignedLong(number: Int, name: String, value: Long): Unit
final def writeNestedBigDecimal(value: BigDecimal): Unit
final def writeNestedBigInteger(value: BigInteger): Unit
final def writeNestedBool(value: Boolean): Unit
final def writeNestedByteArray(value: Array[Byte]): Unit
final def writeNestedCollection[T](col: T)(f: (NestedOutput, T) => Unit): Unit
final def writeNestedDouble(value: Double): Unit
final def writeNestedFixedInt(value: Int): Unit
final def writeNestedFixedLong(value: Long): Unit
final def writeNestedFloat(value: Float): Unit
final def writeNestedInt(value: Int): Unit
final def writeNestedLong(value: Long): Unit
final def writeNestedObject[T](obj: T)(f: (FieldOutput, T) => Unit): Unit
final def writeNestedSignedInt(value: Int): Unit
final def writeNestedSignedLong(value: Long): Unit
final def writeNestedString(value: String): Unit
final def writeNestedUnsignedInt(value: Int): Unit
final def writeNestedUnsignedLong(value: Long): Unit
final def writeRawBigDecimal(value: BigDecimal): Unit
final def writeRawBigInteger(value: BigInteger): Unit
final def writeRawBool(value: Boolean): Unit
final def writeRawByteArray(value: Array[Byte]): Unit
final def writeRawCollection[T](col: T)(f: (NestedOutput, T) => Unit): Unit

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

final def writeRawDouble(value: Double): Unit
final def writeRawFixedInt(value: Int): Unit
final def writeRawFixedLong(value: Long): Unit
final def writeRawFloat(value: Float): Unit
final def writeRawInt(value: Int): Unit
final def writeRawLong(value: Long): Unit
final def writeRawObject[T](obj: T)(f: (FieldOutput, T) => Unit): Unit

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

final def writeRawSignedInt(value: Int): Unit
final def writeRawSignedLong(value: Long): Unit
final def writeRawString(value: String): Unit
final def writeRawUnsignedInt(value: Int): Unit
final def writeRawUnsignedLong(value: Long): Unit
final def writeRawVarint32(value: Int, arr: Array[Byte], off: Int): Int

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

final def writeRawVarint64(value: Long, arr: Array[Byte], off: Int): Int

Encode and write a varint64.

Encode and write a varint64.

Attributes