Trait/Object

com.twitter.io

ByteWriter

Related Docs: object ByteWriter | package io

Permalink

trait ByteWriter extends AnyRef

ByteWriters allow efficient encoding to a buffer. Concatenating Bufs together is a common pattern for codecs (especially on the encode path), but using the concat method on Buf results in a suboptimal representation. In many cases, a ByteWriter not only allows for a more optimal representation (i.e., sequential accessible out regions), but also allows for writes to avoid allocations. What this means in practice is that builders are stateful. Assume that the builder implementations are ""not"" threadsafe unless otherwise noted.

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

Abstract Value Members

  1. abstract def writeByte(b: Int): ByteWriter.this.type

    Permalink

    Write 8 bits of b.

    Write 8 bits of b. The remaining 24 bits are ignored.

  2. abstract def writeBytes(buf: Buf): ByteWriter.this.type

    Permalink

    Write all the bytes from buf into the running buffer.

  3. abstract def writeBytes(bs: Array[Byte]): ByteWriter.this.type

    Permalink

    Write all the bytes from bs into the running buffer.

  4. abstract def writeDoubleBE(d: Double): ByteWriter.this.type

    Permalink

    Write 64 bits from d in big-endian order.

  5. abstract def writeDoubleLE(d: Double): ByteWriter.this.type

    Permalink

    Write 64 bits from d in little-endian order.

  6. abstract def writeFloatBE(f: Float): ByteWriter.this.type

    Permalink

    Write 32 bits from f in big-endian order.

  7. abstract def writeFloatLE(f: Float): ByteWriter.this.type

    Permalink

    Write 32 bits from f in little-endian order.

  8. abstract def writeIntBE(i: Long): ByteWriter.this.type

    Permalink

    Write 32 bits from i in big-endian order.

  9. abstract def writeIntLE(i: Long): ByteWriter.this.type

    Permalink

    Write 32 bits from i in little-endian order.

  10. abstract def writeLongBE(l: Long): ByteWriter.this.type

    Permalink

    Write 64 bits from l in big-endian order.

  11. abstract def writeLongLE(l: Long): ByteWriter.this.type

    Permalink

    Write 64 bits from l in little-endian order.

  12. abstract def writeMediumBE(m: Int): ByteWriter.this.type

    Permalink

    Write 24 bits from m in big-endian order.

    Write 24 bits from m in big-endian order. The remaining 8 bits are ignored.

  13. abstract def writeMediumLE(m: Int): ByteWriter.this.type

    Permalink

    Write 24 bits from m in little-endian order.

    Write 24 bits from m in little-endian order. The remaining 8 bits are ignored.

  14. abstract def writeShortBE(s: Int): ByteWriter.this.type

    Permalink

    Write 16 bits from s in big-endian order.

    Write 16 bits from s in big-endian order. The remaining 16 bits are ignored.

  15. abstract def writeShortLE(s: Int): ByteWriter.this.type

    Permalink

    Write 16 bits from s in little-endian order.

    Write 16 bits from s in little-endian order. The remaining 16 bits are ignored.

  16. abstract def writeString(string: CharSequence, charset: Charset): ByteWriter.this.type

    Permalink

    Write the byte representation of string, encoded using the specified Charset into the running buffer.

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. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped