Class

scorex.util.serialization

VLQByteBufferWriter

Related Doc: package serialization

Permalink

class VLQByteBufferWriter extends Writer with VLQWriter

Not thread safe

Linear Supertypes
VLQWriter, Writer, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. VLQByteBufferWriter
  2. VLQWriter
  3. Writer
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new VLQByteBufferWriter(b: ByteArrayBuilder)

    Permalink

Type Members

  1. type CH = ByteArrayBuilder

    Permalink

    Type of encoded data

    Type of encoded data

    Definition Classes
    VLQByteBufferWriterWriter

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def append(writer: Aux[CH]): VLQByteBufferWriter.this.type

    Permalink

    Append result of $writer to this Writer

    Append result of $writer to this Writer

    writer

    is used as source of bytes

    Definition Classes
    Writer
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def length(): Int

    Permalink

    Length of encoded data

    Length of encoded data

    Definition Classes
    VLQByteBufferWriterWriter
    Annotations
    @inline()
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def newWriter(): Aux[ByteArrayBuilder]

    Permalink

    Creates new instance of this Writer

    Creates new instance of this Writer

    returns

    new instance of Writer

    Definition Classes
    VLQByteBufferWriterWriter
    Annotations
    @inline()
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def put(x: Byte): VLQByteBufferWriter.this.type

    Permalink

    Encode signed byte

    Encode signed byte

    x

    byte value to encode

    Definition Classes
    VLQByteBufferWriterWriter
    Annotations
    @inline()
  19. def putBits(xs: Array[Boolean]): VLQByteBufferWriter.this.type

    Permalink

    Encode an array of boolean values as a bit array

    Encode an array of boolean values as a bit array

    xs

    array of boolean values

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
  20. def putBoolean(x: Boolean): VLQByteBufferWriter.this.type

    Permalink

    Encode boolean

    Encode boolean

    x

    boolean value to encode

    Definition Classes
    VLQByteBufferWriterWriter
    Annotations
    @inline()
  21. def putBytes(xs: Array[Byte]): VLQByteBufferWriter.this.type

    Permalink

    Encode an array of bytes

    Encode an array of bytes

    xs

    value to encode

    Definition Classes
    VLQByteBufferWriterWriter
    Annotations
    @inline()
  22. def putChunk(chunk: ByteArrayBuilder): VLQByteBufferWriter.this.type

    Permalink

    Encode chunk

    Encode chunk

    chunk

    to put into this Writer

    Definition Classes
    VLQByteBufferWriterWriter
    Annotations
    @inline()
  23. def putInt(x: Int): VLQByteBufferWriter.this.type

    Permalink

    Encode signed Int using VLQ with ZigZag.

    Encode signed Int using VLQ with ZigZag. Both negative and positive values are supported, but due to ZigZag encoding positive values is done less efficiently than by putUInt. Use putUInt to encode values that are positive.

    x

    signed Int

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
    Note

    Have to be decoded only with VLQReader.getInt The resulting varint uses ZigZag encoding, which is much more efficient at encoding negative values than pure VLQ.

    See also

    https://en.wikipedia.org/wiki/Variable-length_quantity

  24. def putLong(x: Long): VLQByteBufferWriter.this.type

    Permalink

    Encode signed Long using VLQ with ZigZag.

    Encode signed Long using VLQ with ZigZag. Both negative and positive values are supported, but due to ZigZag encoding positive values is done less efficiently than by putULong. Use putULong to encode values that are positive.

    x

    prefer signed Long

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
    Note

    Have to be decoded only with VLQReader.getLong The resulting varint uses ZigZag encoding, which is much more efficient at encoding negative values than pure VLQ.

    See also

    https://en.wikipedia.org/wiki/Variable-length_quantity

  25. def putOption[T](x: Option[T])(putValue: (VLQByteBufferWriter.this.type, T) ⇒ Unit): VLQByteBufferWriter.this.type

    Permalink

    Encode optional value

    Encode optional value

    x

    optional value to encode

    putValue

    procedure to encode value, if $x is nonempty

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
  26. def putShort(x: Short): VLQByteBufferWriter.this.type

    Permalink

    Encode signed Short using ZigZag and then VLQ.

    Encode signed Short using ZigZag and then VLQ. Both negative and positive values are supported, but due to ZigZag encoding positive values is done less efficiently than by putUShort. Use putUShort to encode values that are always positive.

    x

    signed Short

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
    Note

    Have to be decoded only with VLQReader.getShort The resulting varint uses ZigZag encoding, which is much more efficient at encoding negative values than pure VLQ.

    See also

    https://en.wikipedia.org/wiki/Variable-length_quantity

  27. def putShortString(s: String): VLQByteBufferWriter.this.type

    Permalink

    Encode String is shorter than 256 bytes

    Encode String is shorter than 256 bytes

    s

    String

    Definition Classes
    VLQWriterWriter
  28. def putUByte(x: Int): VLQByteBufferWriter.this.type

    Permalink

    Encode integer as an unsigned byte asserting the range check

    Encode integer as an unsigned byte asserting the range check

    x

    integer value to encode

    Definition Classes
    Writer
    Exceptions thrown

    AssertionError if x is outside of the unsigned byte range

  29. def putUInt(x: Long): VLQByteBufferWriter.this.type

    Permalink

    Encode unsigned Int value using VLQ.

    Encode unsigned Int value using VLQ. Only positive values are supported. Use putInt to encode negative and positive values.

    x

    unsigned Int

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
    Exceptions thrown

    AssertionError for values not in unsigned Int range

    See also

    https://en.wikipedia.org/wiki/Variable-length_quantity

  30. def putULong(x: Long): VLQByteBufferWriter.this.type

    Permalink

    Encode signed Long value using VLQ.

    Encode signed Long value using VLQ. Both negative and positive values are supported, but only positive values are encoded efficiently, negative values are taking a toll and use six bytes. Use putLong to encode negative and positive values.

    x

    prefer unsigned Long (signed value will produce a significant overhead, see note above)

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
    Note

    Don't use it for negative values, the resulting varint is always ten bytes long – it is, effectively, treated like a very large unsigned integer. If you use putLong, the resulting varint uses ZigZag encoding, which is much more efficient.

    See also

    https://en.wikipedia.org/wiki/Variable-length_quantity

  31. def putUShort(x: Int): VLQByteBufferWriter.this.type

    Permalink

    Encode unsigned Short value using VLQ.

    Encode unsigned Short value using VLQ. Only positive values are supported, Use putShort to encode negative and positive values.

    x

    unsigned Short in a range 0 <= x <= 0xFFFF represented as Int

    Definition Classes
    VLQWriterWriter
    Annotations
    @inline()
    Exceptions thrown

    AssertionError for values not in unsigned Short range

    See also

    https://en.wikipedia.org/wiki/Variable-length_quantity

  32. def result(): ByteArrayBuilder

    Permalink

    Returns encoded result

    Returns encoded result

    returns

    encoded result

    Definition Classes
    VLQByteBufferWriterWriter
    Annotations
    @inline()
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def toBytes: Array[Byte]

    Permalink
    Definition Classes
    VLQByteBufferWriterVLQWriter
    Annotations
    @inline()
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from VLQWriter

Inherited from Writer

Inherited from AnyRef

Inherited from Any

Ungrouped