colossus.core

DataBuffer

Related Docs: object DataBuffer | package core

case class DataBuffer(data: ByteBuffer) extends DataReader with Product with Serializable

A thin wrapper around a NIO ByteBuffer with data to read

DataBuffers are the primary way that data is read from and written to a connection. DataBuffers are mutable and not thread safe. They can only be read from once and cannot be reset.

Linear Supertypes
Serializable, Serializable, Product, Equals, DataReader, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DataBuffer
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. DataReader
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DataBuffer(data: ByteBuffer)

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val data: ByteBuffer

  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  10. def hasNext: Boolean

    Returns true if this DataBuffer still has unread data, false otherwise

  11. def hasUnreadData: Boolean

    Returns true if this DataBuffer still has unread data, false otherwise

  12. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  14. def next(): Byte

    Get the next byte, removing it from the buffer

    Get the next byte, removing it from the buffer

    WARNING : This method will throw an exception if no data is left. It is up to you to use hasUnreadData to figure out if you should call this. This is done to avoid unnecessary object allocation with using Option

    returns

    the next byte in the buffer

  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. def peek[T](f: (DataBuffer) ⇒ T): (T, Int)

  18. def remaining: Int

  19. def size: Int

    Returns the total size of this DataBuffer

  20. def skip(n: Int): Unit

    Skip over n bytes in the buffer.

    Skip over n bytes in the buffer.

    n

    the number of bytes to skip.

    Exceptions thrown

    IllegalArgumentException if n is larger than the number of remaining bytes

  21. def skipAll(): Unit

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

    Definition Classes
    AnyRef
  23. def take(n: Int): Array[Byte]

    Get some bytes

    Get some bytes

    n

    how many bytes you want.

    returns

    an filled array of size min(n, remaining)

  24. def takeAll: Array[Byte]

    Returns an array containing all of the unread data in this Databuffer

  25. def takeCopy: DataBuffer

    Copy the unread data in this buffer to a new buffer

    Copy the unread data in this buffer to a new buffer

    Data will not be shared between the buffers. The position of this buffer will be completed

    returns

    a new DataBuffer containing only the unread data in this buffer

  26. def takeInto(buffer: Array[Byte], offset: Int, length: Int): Unit

    Directly copy data into a target byte array

    Directly copy data into a target byte array

    buffer

    the array to copy into

    offset

    the first index of buffer to start writing to

    length

    how many bytes to write

    Exceptions thrown

    ArrayOutOfBoundsException if target array is too small or buffer doesn't have sufficient bytes available

  27. def taken: Int

    Returns how many bytes have already been read from this DataBuffer

  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. def writeTo(channel: SocketChannel): Int

    Write the buffer into a SocketChannel

    Write the buffer into a SocketChannel

    The buffer's taken and remaining values will be updated to reflect how much data was written. Be aware that buffer's containing large amounts of data will probably not be written in one call

    channel

    the channel to write to

    returns

    how many bytes were written

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from DataReader

Inherited from AnyRef

Inherited from Any

Ungrouped