Class/Object

com.twitter.io.Buf

ByteArray

Related Docs: object ByteArray | package Buf

Permalink

class ByteArray extends Buf

A buffer representing an array of bytes.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ByteArray
  2. Buf
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ByteArray(bytes: Array[Byte], begin: Int, end: Int)

    Permalink

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 checkWriteArgs(outputLen: Int, outputOff: Int): Unit

    Permalink

    Helps implementations validate the arguments to write.

    Helps implementations validate the arguments to write.

    Attributes
    protected[this]
    Definition Classes
    Buf
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def computeHashCode: Int

    Permalink

    Compute the 32-bit FNV-1 hash code of this buf.

    Compute the 32-bit FNV-1 hash code of this buf.

    Attributes
    protected
    Definition Classes
    Buf
  8. final def concat(right: Buf): Buf

    Permalink

    Concatenate this buffer with the given buffer.

    Concatenate this buffer with the given buffer.

    Definition Classes
    Buf
  9. def copiedByteArray: Array[Byte]

    Permalink

    Definitely requires copying.

    Definitely requires copying.

    Attributes
    protected
    Definition Classes
    Buf
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(other: Any): Boolean

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def get(index: Int): Byte

    Permalink

    Returns the byte at the given index.

    Returns the byte at the given index.

    Definition Classes
    ByteArrayBuf
  14. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    Buf → AnyRef → Any
  16. def isEmpty: Boolean

    Permalink
    Definition Classes
    Buf
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def isSliceEmpty(from: Int, until: Int): Boolean

    Permalink

    Helps implementations of slice.

    Helps implementations of slice.

    Attributes
    protected[this]
    Definition Classes
    Buf
  19. def isSliceIdentity(from: Int, until: Int): Boolean

    Permalink

    Helps implementations of slice.

    Helps implementations of slice.

    Attributes
    protected[this]
    Definition Classes
    Buf
  20. def length: Int

    Permalink

    The number of bytes in the buffer

    The number of bytes in the buffer

    Definition Classes
    ByteArrayBuf
  21. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  24. def process(from: Int, until: Int, processor: Processor): Int

    Permalink

    Process the Buf 1-byte at a time using the given Buf.Processor, starting at index from until index until.

    Process the Buf 1-byte at a time using the given Buf.Processor, starting at index from until index until. Processing will halt if the processor returns false or after processing the final byte.

    from

    the starting index, inclusive. Must be non-negative.

    until

    the ending index, exclusive. Must be non-negative.

    returns

    -1 if the processor processed all bytes or the last processed index if the processor returns false. Will return -1 if from is greater than or equal to until or length. Will return -1 if until is greater than or equal to length.

    Definition Classes
    ByteArrayBuf
    Note

    this mimics the design of Netty 4's io.netty.buffer.ByteBuf.forEachByte

  25. def process(processor: Processor): Int

    Permalink

    Process the Buf 1-byte at a time using the given Buf.Processor, starting at index 0 until index length.

    Process the Buf 1-byte at a time using the given Buf.Processor, starting at index 0 until index length. Processing will halt if the processor returns false or after processing the final byte.

    returns

    -1 if the processor processed all bytes or the last processed index if the processor returns false.

    Definition Classes
    Buf
    Note

    this mimics the design of Netty 4's io.netty.buffer.ByteBuf.forEachByte

  26. def slice(from: Int, until: Int): Buf

    Permalink

    Returns a new buffer representing a slice of this buffer, delimited by the indices from inclusive and until exclusive: [from, until).

    Returns a new buffer representing a slice of this buffer, delimited by the indices from inclusive and until exclusive: [from, until). Out of bounds indices are truncated. Negative indices are not accepted.

    Definition Classes
    ByteArrayBuf
    Note

    Buf implementors should use the helpers Buf.checkSliceArgs, isSliceEmpty, and isSliceIdentity.

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

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

    Permalink
    Definition Classes
    ByteArray → AnyRef → Any
  29. def unsafeByteArray: Array[Byte]

    Permalink

    May require copying.

    May require copying.

    Attributes
    protected
    Definition Classes
    Buf
  30. def unsafeByteArrayBuf: Option[ByteArray]

    Permalink

    Helper to support 0-copy coercion to Buf.ByteArray.

    Helper to support 0-copy coercion to Buf.ByteArray.

    Attributes
    protected
    Definition Classes
    ByteArrayBuf
  31. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. def write(buffer: java.nio.ByteBuffer): Unit

    Permalink

    Write the entire contents of this Buf into the given nio buffer.

    Write the entire contents of this Buf into the given nio buffer. Partial writes aren't supported directly through this API; they can be accomplished by first slicing the buffer. This method should be preferred over Buf.ByteBuffer.extract, Buf.ByteArray.Owned, etc family of functions when you want to control the destination of the data, as opposed to letting the Buf implementation manage the destination. For example, if the data is destined for an IO operation, it may be preferable to provide a direct nio ByteBuffer to ensure the avoidance of intermediate heap-based representations.

    Definition Classes
    ByteArrayBuf
    Exceptions thrown

    ReadOnlyBufferException if the provided buffer is read-only.

    java.lang.IllegalArgumentException when output doesn't have enough space as defined by ByteBuffer.remaining() to hold the contents of this Buf.

    Note

    Buf implementors should use the helper checkWriteArgs.

    See also

    Int) for writing to byte arrays.

  35. def write(buf: Array[Byte], off: Int): Unit

    Permalink

    Write the entire contents of this Buf into the given array at the given offset.

    Write the entire contents of this Buf into the given array at the given offset. Partial writes aren't supported directly through this API; they can be accomplished by first slicing the buffer. This method should be preferred over the Buf.ByteArray.extract, Buf.ByteArray.Owned, etc family of functions when you want to control the destination of the data, as opposed to letting the Buf implementation manage the destination. For example, if you want to manually set the first bytes of an Array[Byte] and then efficiently copy the contents of this Buf to the remaining space.

    Definition Classes
    ByteArrayBuf
    Exceptions thrown

    IllegalArgumentException when output is too small to contain all the data.

    Note

    Buf implementors should use the helper checkWriteArgs.

    See also

    write(ByteBuffer) for writing to nio buffers.

Inherited from Buf

Inherited from AnyRef

Inherited from Any

Ungrouped