Packages

trait NiolInput extends AnyRef

An advanced input.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NiolInput
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def _read(): Byte

    Implements read without necessarily checking for available data.

    Implements read without necessarily checking for available data.

    Attributes
    protected[niol]
  2. abstract def isEnded: Boolean

    Checks if this input is closed or has definitively reached its end.

    Checks if this input is closed or has definitively reached its end. If isEnded == true then isReadable == false.

    returns

    true if it's closed or has definitively reached its end, false otherwise

  3. abstract def isReadable: Boolean

    * Checks if a byte can be read from this NiolInput.

    * Checks if a byte can be read from this NiolInput.

    returns

    true if at least one byte can be read, false otherwise

  4. abstract def read(dst: ByteBuffer): Unit

    Fills the given ByteBuffer.

    Fills the given ByteBuffer. Throws an exception if there isn't enough data available.

    dst

    the buffer to fill

  5. abstract def read(dst: NiolBuffer): Unit

    Fills the given NiolBuffer.

    Fills the given NiolBuffer. Throws an exception if there isn't enough data available.

    dst

    the buffer to fill

  6. abstract def readSome(dst: ByteBuffer): Int

    Reads at most dst.remaining() bytes into dst.

    Reads at most dst.remaining() bytes into dst. The buffer's position will be advanced by the number of bytes read from this NiolInput.

    dst

    the buffer to fill

  7. abstract def readSome(dst: NiolBuffer): Int

    Reads at most dst.writableBytes bytes into dst.

    Reads at most dst.writableBytes bytes into dst. The buffer's position will be advanced by the number of bytes read from this NiolInput.

    dst

    the buffer to fill

Concrete 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[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. def r(): Byte

    Reads a byte

  16. def readBool(): Boolean

    Reads a boolean.

  17. def readBoolF(falseValue: Byte): Boolean

    Reads one byte and returns false if it's equal to the given value, true otherwise.

  18. def readBoolT(trueValue: Byte): Boolean

    Reads one byte and returns true if it's equal to the given value, false otherwise.

  19. def readBoolean(): Boolean

    Reads a boolean

  20. final def readByte(): Byte

    Reads a byte

  21. def readBytes(dst: Array[Byte], offset: Int, length: Int): Unit

    Reads the next length bytes and put them into dst at the given offset.

    Reads the next length bytes and put them into dst at the given offset. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of bytes to read

  22. def readBytes(dst: Array[Byte]): Unit

    Reads the next dst.length bytes and put them into dst.

    Reads the next dst.length bytes and put them into dst. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  23. def readBytes(n: Int): Array[Byte]

    Reads the next n bytes.

    Reads the next n bytes. Throws an Exception if there isn't enough data available.

    n

    the number of bytes to read

  24. def readChar(): Char

    Reads a big-endian char

  25. def readCharLE(): Char

    Reads a little-endian char

  26. final def readCharSequence(bytesLength: Int, charset: Charset = UTF_8): CharSequence

    Reads the next bytesLength bytes as a CharSequence encoded with the given charset.

  27. def readDouble(): Double

    Reads a big-endian 8-bytes double

  28. def readDoubleLE(): Double

    Reads a little-endian 8-bytes double

  29. def readDoubles(dst: Array[Double], offset: Int, length: Int): Unit

    Reads the next length doubles and put them into dst at the given offset.

    Reads the next length doubles and put them into dst at the given offset. Uses big-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of doubles to read

  30. def readDoubles(dst: Array[Double]): Unit

    Reads the next dst.length doubles and put them into dst.

    Reads the next dst.length doubles and put them into dst. Uses big-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  31. def readDoubles(n: Int): Array[Double]

    Reads the next n doubles.

    Reads the next n doubles. Uses big-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of doubles to read

  32. def readDoublesLE(dst: Array[Double], offset: Int, length: Int): Unit

    Reads the next length doubles and put them into dst at the given offset.

    Reads the next length doubles and put them into dst at the given offset. Uses little-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of doubles to read

  33. def readDoublesLE(dst: Array[Double]): Unit

    Reads the next dst.length doubles and put them into dst.

    Reads the next dst.length doubles and put them into dst. Uses little-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  34. def readDoublesLE(n: Int): Array[Double]

    Reads the next n doubles.

    Reads the next n doubles. Uses little-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of doubles to read

  35. def readFloat(): Float

    Reads a big-endian 4-bytes float

  36. def readFloatLE(): Float

    Reads a little-endian 4-bytes float

  37. def readFloats(dst: Array[Float], offset: Int, length: Int): Unit

    Reads the next length floats and put them into dst at the given offset.

    Reads the next length floats and put them into dst at the given offset. Uses big-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of floats to read

  38. def readFloats(dst: Array[Float]): Unit

    Reads the next dst.length floats and put them into dst.

    Reads the next dst.length floats and put them into dst. Uses big-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  39. def readFloats(n: Int): Array[Float]

    Reads the next n floats.

    Reads the next n floats. Uses big-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of floats to read

  40. def readFloatsLE(dst: Array[Float], offset: Int, length: Int): Unit

    Reads the next length floats and put them into dst at the given offset.

    Reads the next length floats and put them into dst at the given offset. Uses little-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of floats to read

  41. def readFloatsLE(dst: Array[Float]): Unit

    Reads the next dst.length floats and put them into dst.

    Reads the next dst.length floats and put them into dst. Uses little-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  42. def readFloatsLE(n: Int): Array[Float]

    Reads the next n floats.

    Reads the next n floats. Uses little-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of floats to read

  43. def readInt(): Int

    Reads a big-endian 4-bytes integer

  44. def readIntLE(): Int

    Reads a little-endian 4-bytes integer

  45. def readInts(dst: Array[Int], offset: Int, length: Int): Unit

    Reads the next length ints and put them into dst at the given offset.

    Reads the next length ints and put them into dst at the given offset. Uses big-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of ints to read

  46. def readInts(dst: Array[Int]): Unit

    Reads the next dst.length ints and put them into dst.

    Reads the next dst.length ints and put them into dst. Uses big-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  47. def readInts(n: Int): Array[Int]

    Reads the next n ints.

    Reads the next n ints. Uses big-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of ints to read

  48. def readIntsLE(dst: Array[Int], offset: Int, length: Int): Unit

    Reads the next length ints and put them into dst at the given offset.

    Reads the next length ints and put them into dst at the given offset. Uses little-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of ints to read

  49. def readIntsLE(dst: Array[Int]): Unit

    Reads the next dst.length ints and put them into dst.

    Reads the next dst.length ints and put them into dst. Uses little-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  50. def readIntsLE(n: Int): Array[Int]

    Reads the next n ints.

    Reads the next n ints. Uses little-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of ints to read

  51. def readLong(): Long

    Reads a big-endian 8-bytes integer

  52. def readLongLE(): Long

    Reads a little-endian 8-bytes integer

  53. def readLongs(dst: Array[Long], offset: Int, length: Int): Unit

    Reads the next length longs and put them into dst at the given offset.

    Reads the next length longs and put them into dst at the given offset. Uses big-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of longs to read

  54. def readLongs(dst: Array[Long]): Unit

    Reads the next dst.length longs and put them into dst.

    Reads the next dst.length longs and put them into dst. Uses big-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  55. def readLongs(n: Int): Array[Long]

    Reads the next n longs.

    Reads the next n longs. Uses big-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of longs to read

  56. def readLongsLE(dst: Array[Long], offset: Int, length: Int): Unit

    Reads the next length longs and put them into dst at the given offset.

    Reads the next length longs and put them into dst at the given offset. Uses little-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of longs to read

  57. def readLongsLE(dst: Array[Long]): Unit

    Reads the next dst.length longs and put them into dst.

    Reads the next dst.length longs and put them into dst. Uses little-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  58. def readLongsLE(n: Int): Array[Long]

    Reads the next n longs.

    Reads the next n longs. Uses little-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of longs to read

  59. def readMedium(): Int

    Reads a big-endian 3-bytes integer

  60. def readMediumLE(): Int

    Reads a little-endian 3-bytes integer

  61. final def readSVarIntZigZag(maxBytes: Int = 5): Int

    Reads a variable-length int using the signed/zig-zag encoding.

  62. final def readSVarLongZigZag(maxBytes: Int = 10): Long

    Reads a variable-length long using the signed/zig-zag encoding.

  63. def readShort(): Short

    Reads a big-endian short

  64. final def readShortCharSequence(charset: Charset = UTF_8): CharSequence

    Reads a big-endian unsigned short to determine the sequence's length, then reads it.

  65. final def readShortCharSequenceLE(charset: Charset = UTF_8): CharSequence

    Reads a little-endian unsigned short to determine the sequence's length, then reads it.

  66. def readShortLE(): Short

    Reads a little-endian short

  67. final def readShortString(charset: Charset = UTF_8): String

    Reads a big-endian unsigned short to determine the string's length, then reads it.

  68. final def readShortStringLE(charset: Charset = UTF_8): String

    Reads a little-endian unsigned short to determine the string's length, then reads it.

  69. def readShorts(dst: Array[Short], offset: Int, length: Int): Unit

    Reads the next length shorts and put them into dst at the given offset.

    Reads the next length shorts and put them into dst at the given offset. Uses big-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of shorts to read

  70. def readShorts(dst: Array[Short]): Unit

    Reads the next dst.length shorts and put them into dst.

    Reads the next dst.length shorts and put them into dst. Uses big-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  71. def readShorts(n: Int): Array[Short]

    Reads the next n shorts.

    Reads the next n shorts. Uses big-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of shorts to read

  72. def readShortsLE(dst: Array[Short], offset: Int, length: Int): Unit

    Reads the next length shorts and put them into dst at the given offset.

    Reads the next length shorts and put them into dst at the given offset. Uses little-endian for each value. Throws an exception if there isn't enough data available.

    dst

    the array to fill

    offset

    the first index to use

    length

    the number of shorts to read

  73. def readShortsLE(dst: Array[Short]): Unit

    Reads the next dst.length shorts and put them into dst.

    Reads the next dst.length shorts and put them into dst. Uses little-endian for each value. Throws an exception if there isn't enough data to fill the array.

    dst

    the array to fill

  74. def readShortsLE(n: Int): Array[Short]

    Reads the next n shorts.

    Reads the next n shorts. Uses little-endian for each value. Throws an Exception if there isn't enough data available.

    n

    the number of shorts to read

  75. def readSomeBytes(dst: Array[Byte], offset: Int, maxLength: Int): Int

    Reads at most length bytes and put them into dst at the given offset.

    Reads at most length bytes and put them into dst at the given offset. Returns the actual number of bytes read, possibly zero.

    dst

    the array to fill

    offset

    the first index to use

    maxLength

    the maximum number of bytes to read

    returns

    the number of bytes read

  76. def readSomeBytes(dst: Array[Byte]): Int

    Reads at most dst.length bytes into dst.

    Reads at most dst.length bytes into dst. Returns the actual number of bytes read, possibly zero.

    dst

    the array to fill

    returns

    the number of bytes read

  77. final def readString(bytesLength: Int, charset: Charset = UTF_8): String

    Reads the next bytesLength bytes as a String encoded with the given charset.

  78. final def readUUID(): UUID

    Reads a big-endian 16-bytes UUID

  79. final def readUnsignedByte(): Int

    Reads an unsigned byte as an int

  80. final def readUnsignedInt(): Long

    Reads a big-endian unsigned int as a long

  81. final def readUnsignedIntLE(): Long

    Reads a little-endian unsigned int as a long

  82. final def readUnsignedMedium(): Int

    Reads a big-endian unsigned medium as an int

  83. final def readUnsignedMediumLE(): Int

    Reads a little-endian unsigned medium as an int

  84. final def readUnsignedShort(): Int

    Reads a big-endian unsigned short as an int

  85. final def readUnsignedShortLE(): Int

    Reads a little-endian unsigned short as an int

  86. final def readVarCharSequence(charset: Charset = UTF_8): CharSequence

    Reads a VarInt to determine the sequence's length, then reads the CharSequence.

  87. def readVarInt(maxBytes: Int = 5): Int

    Reads a variable-length int using the normal/unsigned encoding.

  88. def readVarLong(maxBytes: Int = 10): Long

    Reads a variable-length long using the normal/unsigned encoding.

  89. final def readVarString(charset: Charset = UTF_8): String

    Reads a VarInt to determine the string's length, then reads the string.

  90. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  91. def toString(): String
    Definition Classes
    AnyRef → Any
  92. def tryRead(): Int

    Attempts to read a byte.

    Attempts to read a byte. If the input is empty, returns -1. Otherwise, returns the byte value as an int in the range 0-255.

    returns

    the byte value in range 0-255, or -1 if the input is empty

  93. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  94. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  95. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped