trait VLQWriter extends Writer
- Alphabetic
- By Inheritance
- VLQWriter
- Writer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def length(): Int
Length of encoded data
Length of encoded data
- Definition Classes
- Writer
- abstract def newWriter(): Aux[CH]
Creates new instance of this Writer
- abstract def put(x: Byte): VLQWriter.this.type
Encode signed byte
- abstract def putBoolean(x: Boolean): VLQWriter.this.type
Encode boolean
- abstract def putBytes(xs: Array[Byte], offset: Int, length: Int): VLQWriter.this.type
Encode a slice of array of bytes.
Encode a slice of array of bytes.
- xs
an array to take bytes from
- offset
first byte of the slice
- length
of the slice (number of bytes)
- Definition Classes
- Writer
- abstract def putBytes(xs: Array[Byte]): VLQWriter.this.type
Encode an array of bytes
- abstract def putChunk(chunk: CH): VLQWriter.this.type
Encode chunk
- abstract def result(): CH
Returns encoded result
- abstract def toBytes: Array[Byte]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def append(writer: Aux[CH]): VLQWriter.this.type
Append result of $writer to this Writer
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def putBits(xs: Array[Boolean]): VLQWriter.this.type
Encode an array of boolean values as a bit array
- def putInt(x: Int): VLQWriter.this.type
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
- VLQWriter → Writer
- 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
- def putLong(x: Long): VLQWriter.this.type
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
- VLQWriter → Writer
- 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
- def putOption[T](x: Option[T])(putValue: (VLQWriter.this.type, T) => Unit): VLQWriter.this.type
Encode optional value
- def putShort(x: Short): VLQWriter.this.type
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
- VLQWriter → Writer
- 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
- def putShortString(s: String): VLQWriter.this.type
Encode String is shorter than 256 bytes
- def putUByte(x: Int): VLQWriter.this.type
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
AssertionErrorif x is outside of the unsigned byte range
- def putUInt(x: Long): VLQWriter.this.type
Encode unsigned Int value using VLQ.
- def putULong(x: Long): VLQWriter.this.type
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
- VLQWriter → Writer
- 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
- def putUShort(x: Int): VLQWriter.this.type
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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated