Packages

c

com.electronwill.niol.io

ChannelInput

final class ChannelInput extends NiolInput with Closeable

A NiolInput based on a ByteChannel. The channel must be in blocking mode for the ChannelInput to work correctly.

Linear Supertypes
Closeable, AutoCloseable, NiolInput, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ChannelInput
  2. Closeable
  3. AutoCloseable
  4. NiolInput
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ChannelInput(path: Path, prov: StorageProvider)
  2. new ChannelInput(path: Path, storage: BytesStorage)
  3. new ChannelInput(fc: FileChannel, prov: StorageProvider)
  4. new ChannelInput(channel: ScatteringByteChannel, storage: BytesStorage)

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. def _read(): Byte

    Implements read without necessarily checking for available data.

    Implements read without necessarily checking for available data.

    Attributes
    protected[niol]
    Definition Classes
    ChannelInputNiolInput
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val channel: ScatteringByteChannel
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def close(): Unit
    Definition Classes
    ChannelInput → Closeable → AutoCloseable
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. 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

    Definition Classes
    ChannelInputNiolInput
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. 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

    Definition Classes
    ChannelInputNiolInput
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def r(): Byte

    Reads a byte

    Reads a byte

    Definition Classes
    NiolInput
  21. 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

    Definition Classes
    ChannelInputNiolInput
  22. 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

    Definition Classes
    ChannelInputNiolInput
  23. def readBool(): Boolean

    Reads a boolean.

    Reads a boolean.

    Definition Classes
    NiolInput
  24. def readBoolF(falseValue: Byte): Boolean

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

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

    Definition Classes
    NiolInput
  25. def readBoolT(trueValue: Byte): Boolean

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

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

    Definition Classes
    NiolInput
  26. def readBoolean(): Boolean

    Reads a boolean

    Reads a boolean

    Definition Classes
    NiolInput
  27. final def readByte(): Byte

    Reads a byte

    Reads a byte

    Definition Classes
    NiolInput
  28. 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

    Definition Classes
    ChannelInputNiolInput
  29. 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

    Definition Classes
    NiolInput
  30. 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

    Definition Classes
    NiolInput
  31. def readChar(): Char

    Reads a big-endian char

    Reads a big-endian char

    Definition Classes
    ChannelInputNiolInput
  32. def readCharLE(): Char

    Reads a little-endian char

    Reads a little-endian char

    Definition Classes
    NiolInput
  33. final def readCharSequence(bytesLength: Int, charset: Charset = UTF_8): CharSequence

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

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

    Definition Classes
    NiolInput
  34. def readDouble(): Double

    Reads a big-endian 8-bytes double

    Reads a big-endian 8-bytes double

    Definition Classes
    ChannelInputNiolInput
  35. def readDoubleLE(): Double

    Reads a little-endian 8-bytes double

    Reads a little-endian 8-bytes double

    Definition Classes
    NiolInput
  36. 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

    Definition Classes
    NiolInput
  37. 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

    Definition Classes
    NiolInput
  38. 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

    Definition Classes
    NiolInput
  39. 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

    Definition Classes
    NiolInput
  40. 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

    Definition Classes
    NiolInput
  41. 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

    Definition Classes
    NiolInput
  42. def readFloat(): Float

    Reads a big-endian 4-bytes float

    Reads a big-endian 4-bytes float

    Definition Classes
    ChannelInputNiolInput
  43. def readFloatLE(): Float

    Reads a little-endian 4-bytes float

    Reads a little-endian 4-bytes float

    Definition Classes
    NiolInput
  44. 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

    Definition Classes
    NiolInput
  45. 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

    Definition Classes
    NiolInput
  46. 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

    Definition Classes
    NiolInput
  47. 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

    Definition Classes
    NiolInput
  48. 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

    Definition Classes
    NiolInput
  49. 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

    Definition Classes
    NiolInput
  50. def readInt(): Int

    Reads a big-endian 4-bytes integer

    Reads a big-endian 4-bytes integer

    Definition Classes
    ChannelInputNiolInput
  51. def readIntLE(): Int

    Reads a little-endian 4-bytes integer

    Reads a little-endian 4-bytes integer

    Definition Classes
    NiolInput
  52. 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

    Definition Classes
    NiolInput
  53. 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

    Definition Classes
    NiolInput
  54. 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

    Definition Classes
    NiolInput
  55. 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

    Definition Classes
    NiolInput
  56. 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

    Definition Classes
    NiolInput
  57. 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

    Definition Classes
    NiolInput
  58. def readLong(): Long

    Reads a big-endian 8-bytes integer

    Reads a big-endian 8-bytes integer

    Definition Classes
    ChannelInputNiolInput
  59. def readLongLE(): Long

    Reads a little-endian 8-bytes integer

    Reads a little-endian 8-bytes integer

    Definition Classes
    NiolInput
  60. 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

    Definition Classes
    NiolInput
  61. 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

    Definition Classes
    NiolInput
  62. 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

    Definition Classes
    NiolInput
  63. 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

    Definition Classes
    NiolInput
  64. 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

    Definition Classes
    NiolInput
  65. 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

    Definition Classes
    NiolInput
  66. def readMedium(): Int

    Reads a big-endian 3-bytes integer

    Reads a big-endian 3-bytes integer

    Definition Classes
    NiolInput
  67. def readMediumLE(): Int

    Reads a little-endian 3-bytes integer

    Reads a little-endian 3-bytes integer

    Definition Classes
    NiolInput
  68. final def readSVarIntZigZag(maxBytes: Int = 5): Int

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

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

    Definition Classes
    NiolInput
  69. final def readSVarLongZigZag(maxBytes: Int = 10): Long

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

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

    Definition Classes
    NiolInput
  70. def readShort(): Short

    Reads a big-endian short

    Reads a big-endian short

    Definition Classes
    ChannelInputNiolInput
  71. final def readShortCharSequence(charset: Charset = UTF_8): CharSequence

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

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

    Definition Classes
    NiolInput
  72. final def readShortCharSequenceLE(charset: Charset = UTF_8): CharSequence

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

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

    Definition Classes
    NiolInput
  73. def readShortLE(): Short

    Reads a little-endian short

    Reads a little-endian short

    Definition Classes
    NiolInput
  74. final def readShortString(charset: Charset = UTF_8): String

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

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

    Definition Classes
    NiolInput
  75. final def readShortStringLE(charset: Charset = UTF_8): String

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

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

    Definition Classes
    NiolInput
  76. 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

    Definition Classes
    NiolInput
  77. 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

    Definition Classes
    NiolInput
  78. 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

    Definition Classes
    NiolInput
  79. 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

    Definition Classes
    NiolInput
  80. 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

    Definition Classes
    NiolInput
  81. 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

    Definition Classes
    NiolInput
  82. 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

    Definition Classes
    ChannelInputNiolInput
  83. 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

    Definition Classes
    ChannelInputNiolInput
  84. 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

    Definition Classes
    NiolInput
  85. 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

    Definition Classes
    NiolInput
  86. final def readString(bytesLength: Int, charset: Charset = UTF_8): String

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

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

    Definition Classes
    NiolInput
  87. final def readUUID(): UUID

    Reads a big-endian 16-bytes UUID

    Reads a big-endian 16-bytes UUID

    Definition Classes
    NiolInput
  88. final def readUnsignedByte(): Int

    Reads an unsigned byte as an int

    Reads an unsigned byte as an int

    Definition Classes
    NiolInput
  89. final def readUnsignedInt(): Long

    Reads a big-endian unsigned int as a long

    Reads a big-endian unsigned int as a long

    Definition Classes
    NiolInput
  90. final def readUnsignedIntLE(): Long

    Reads a little-endian unsigned int as a long

    Reads a little-endian unsigned int as a long

    Definition Classes
    NiolInput
  91. final def readUnsignedMedium(): Int

    Reads a big-endian unsigned medium as an int

    Reads a big-endian unsigned medium as an int

    Definition Classes
    NiolInput
  92. final def readUnsignedMediumLE(): Int

    Reads a little-endian unsigned medium as an int

    Reads a little-endian unsigned medium as an int

    Definition Classes
    NiolInput
  93. final def readUnsignedShort(): Int

    Reads a big-endian unsigned short as an int

    Reads a big-endian unsigned short as an int

    Definition Classes
    NiolInput
  94. final def readUnsignedShortLE(): Int

    Reads a little-endian unsigned short as an int

    Reads a little-endian unsigned short as an int

    Definition Classes
    NiolInput
  95. final def readVarCharSequence(charset: Charset = UTF_8): CharSequence

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

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

    Definition Classes
    NiolInput
  96. def readVarInt(maxBytes: Int = 5): Int

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

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

    Definition Classes
    NiolInput
  97. def readVarLong(maxBytes: Int = 10): Long

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

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

    Definition Classes
    NiolInput
  98. final def readVarString(charset: Charset = UTF_8): String

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

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

    Definition Classes
    NiolInput
  99. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  100. def toString(): String
    Definition Classes
    AnyRef → Any
  101. 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

    Definition Classes
    NiolInput
  102. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  103. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  104. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Closeable

Inherited from AutoCloseable

Inherited from NiolInput

Inherited from AnyRef

Inherited from Any

Ungrouped