Trait

scorex.util.serialization

VLQWriter

Related Doc: package serialization

Permalink

trait VLQWriter extends Writer

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

Type Members

  1. abstract type CH

    Permalink

    Type of encoded data

    Type of encoded data

    Definition Classes
    Writer

Abstract Value Members

  1. abstract def length(): Int

    Permalink

    Length of encoded data

    Length of encoded data

    Definition Classes
    Writer
  2. abstract def newWriter(): Aux[CH]

    Permalink

    Creates new instance of this Writer

    Creates new instance of this Writer

    returns

    new instance of Writer

    Definition Classes
    Writer
  3. abstract def put(x: Byte): VLQWriter.this.type

    Permalink

    Encode signed byte

    Encode signed byte

    x

    byte value to encode

    Definition Classes
    Writer
  4. abstract def putBoolean(x: Boolean): VLQWriter.this.type

    Permalink

    Encode boolean

    Encode boolean

    x

    boolean value to encode

    Definition Classes
    Writer
  5. abstract def putBytes(xs: Array[Byte]): VLQWriter.this.type

    Permalink

    Encode an array of bytes

    Encode an array of bytes

    xs

    value to encode

    Definition Classes
    Writer
  6. abstract def putChunk(chunk: CH): VLQWriter.this.type

    Permalink

    Encode chunk

    Encode chunk

    chunk

    to put into this Writer

    Definition Classes
    Writer
  7. abstract def result(): CH

    Permalink

    Returns encoded result

    Returns encoded result

    returns

    encoded result

    Definition Classes
    Writer
  8. abstract def toBytes: Array[Byte]

    Permalink

Concrete 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]): VLQWriter.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. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  16. def putBits(xs: Array[Boolean]): VLQWriter.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()
  17. def putInt(x: Int): VLQWriter.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

  18. def putLong(x: Long): VLQWriter.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

  19. def putOption[T](x: Option[T])(putValue: (VLQWriter.this.type, T) ⇒ Unit): VLQWriter.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()
  20. def putShort(x: Short): VLQWriter.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

  21. def putShortString(s: String): VLQWriter.this.type

    Permalink

    Encode String is shorter than 256 bytes

    Encode String is shorter than 256 bytes

    s

    String

    Definition Classes
    VLQWriterWriter
  22. def putUByte(x: Int): VLQWriter.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

  23. def putUInt(x: Long): VLQWriter.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

  24. def putULong(x: Long): VLQWriter.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

  25. def putUShort(x: Int): VLQWriter.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

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

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

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

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

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

Inherited from Writer

Inherited from AnyRef

Inherited from Any

Ungrouped