abstract class NiolBuffer extends NiolInput with NiolOutput
- Alphabetic
- By Inheritance
- NiolBuffer
- NiolOutput
- NiolInput
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new NiolBuffer()
Abstract Value Members
-
abstract
def
_read(to: NiolBuffer, len: Int): Unit
Implements read without necessarily checking for available space.
Implements read without necessarily checking for available space.
- Attributes
- protected[niol]
-
abstract
def
_read(to: ByteBuffer, len: Int): Unit
Implements read without necessarily checking for available space.
Implements read without necessarily checking for available space.
- Attributes
- protected[niol]
-
abstract
def
_read(to: Array[Byte], off: Int, len: Int): Unit
Implements read without necessarily checking for available space.
Implements read without necessarily checking for available space.
- Attributes
- protected[niol]
-
abstract
def
_read(): Byte
Implements read without necessarily checking for available data.
-
abstract
def
_write(from: ByteBuffer, len: Int): Unit
Implements write without necessarily checking for available space.
Implements write without necessarily checking for available space.
- Attributes
- protected[niol]
- Definition Classes
- NiolOutput
-
abstract
def
_write(from: Array[Byte], off: Int, len: Int): Unit
Implements write without necessarily checking for available space.
Implements write without necessarily checking for available space.
- Attributes
- protected[niol]
- Definition Classes
- NiolOutput
-
abstract
def
_write(b: Byte): Unit
Implements write without necessarily checking for available space.
Implements write without necessarily checking for available space.
- Attributes
- protected[niol]
- Definition Classes
- NiolOutput
-
abstract
def
advance(n: Int): Unit
Advances the read position by n bytes, as if n bytes had been read into some destination.
Advances the read position by n bytes, as if n bytes had been read into some destination.
- n
the number of bytes to skip
-
abstract
def
capacity: Int
The buffer's capacity.
The buffer's capacity.
- returns
the current capcity
-
abstract
def
clear(): Unit
Makes the buffer empty.
Makes the buffer empty. After a call to
clear, isReadable returnsfalse, readableBytes returns zero and writableBytes returns the buffer's capacity. The buffer's capacity is not modified. -
abstract
def
duplicate: NiolBuffer
Returns a new buffer that shares its content with this buffer, but has independent read and write positions.
Returns a new buffer that shares its content with this buffer, but has independent read and write positions. Initially the positions are the same but they evolve differently.
- returns
the duplicate
-
abstract
def
isEmpty: Boolean
Checks if the buffer is empty, that is, if
readableBytes == 0.Checks if the buffer is empty, that is, if
readableBytes == 0.- returns
true if no byte can be read from this buffer
-
abstract
def
isFull: Boolean
Checks if the buffer is full, that is, if
writableBytes == 0.Checks if the buffer is full, that is, if
writableBytes == 0.- returns
true if no byte can be written to this buffer
-
abstract
def
readSome(dst: OutputStream): Int
Reads some bytes and writes them to
dst.Reads some bytes and writes them to
dst. Returns the actual number of bytes read, possibly zero.- dst
the channel to write to
- returns
the number of bytes read
-
abstract
def
readSome(dst: GatheringByteChannel): Int
Reads some bytes and writes them to
dst.Reads some bytes and writes them to
dst. Returns the actual number of bytes read, possibly zero.- dst
the channel to write to
- returns
the number of bytes read
-
abstract
def
readSome(dst: NiolBuffer): Int
Reads at most
dst.writableBytesbytes intodst.Reads at most
dst.writableBytesbytes intodst. The buffer's position will be advanced by the number of bytes read from this NiolInput.- dst
the buffer to fill
- Definition Classes
- NiolInput
-
abstract
def
readableBytes: Int
The number of bytes that can be read from this buffer.
The number of bytes that can be read from this buffer. This number is always >= 0. If
readableBytes == 0then no byte can be read andisReadable == false.- returns
n > 0 if can read n bytes, 0 if closed input or empty buffer
-
abstract
def
slice(length: Int): NiolBuffer
Creates a "slice" that gives a limited access to the next
lengthreadable bytes.Creates a "slice" that gives a limited access to the next
lengthreadable bytes. No copy is involved. Throws an exception ifreadableBytes < length. The returned buffer satisfiesreadableBytes == length.- length
the length of the slice
- returns
the slice
-
abstract
def
writableBytes: Int
The number of bytes that can be written to this NiolOutput.
The number of bytes that can be written to this NiolOutput. This number is always >= 0. It may be underestimated except when it's zero, that is, if
writableBytes == 0then no byte can be written andisWritable == false.- returns
n > 0 if can write n bytes, 0 if closed output or full buffer
- Definition Classes
- NiolOutput
-
abstract
def
writableSlice(length: Int): NiolBuffer
Creates a "slice" that gives a limited access to the next
lengthwritable bytes.Creates a "slice" that gives a limited access to the next
lengthwritable bytes. No copy is involved. Throws an exception ifwritableBytes < length. The returned buffer satisfieswritableBytes == length.- length
the length of the slice
- returns
the writable slice
-
abstract
def
write(src: NiolBuffer): Unit
Writes all of the given NiolBuffer.
Writes all of the given NiolBuffer. Throws an exception if there isn't enough space for the data.
- src
the buffer to write
- Definition Classes
- NiolOutput
-
abstract
def
writeSome(src: InputStream): Int
Writes some bytes from
src.Writes some bytes from
src. Returns the actual number of bytes written, possibly zero.- src
the stream providing the data
- returns
the number of bytes read from
src, or -1 if the end of the stream has been reached
-
abstract
def
writeSome(src: ScatteringByteChannel): Int
Writes at most
maxBytesbytes fromsrc.Writes at most
maxBytesbytes fromsrc. Returns the actual number of bytes written, possibly zero.- src
the channel providing the data
- returns
the number of bytes read from
src, or -1 if the end of the stream has been reached
-
abstract
def
writeSome(src: NiolBuffer): Int
Writes at most
src.readableBytesbytes fromsrcinto this output.Writes at most
src.readableBytesbytes fromsrcinto this output. The buffer's read position will be advanced by the number of bytes written to this NiolOutput.- src
the buffer to write
- Definition Classes
- NiolOutput
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
+(other: NiolBuffer): BiBuffer
Creates a new BiBuffer made of this buffer plus the other buffer, in this order.
Creates a new BiBuffer made of this buffer plus the other buffer, in this order.
- other
the other buffer
- returns
a new BiBuffer(thisBuffer, other)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
_write(b: Long): Unit
Implements write without necessarily checking for available space.
Implements write without necessarily checking for available space.
- Attributes
- protected[niol]
- Definition Classes
- NiolOutput
-
final
def
_write(b: Int): Unit
Implements write without necessarily checking for available space.
Implements write without necessarily checking for available space.
- Attributes
- protected[niol]
- Definition Classes
- NiolOutput
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
check(nValues: Int, n: Int): Unit
Checks if at least
nbytes can be writtenChecks if at least
nbytes can be written- Attributes
- protected[niol]
- Definition Classes
- NiolOutput
-
def
checkReadable(n: Int): Unit
Checks if at least
nbytes can be writtenChecks if at least
nbytes can be written- Attributes
- protected[niol]
-
def
checkWritable(n: Int): Unit
Checks if at least
nbytes can be writtenChecks if at least
nbytes can be written- Attributes
- protected[niol]
- Definition Classes
- NiolOutput
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isEnded: Boolean
True if this output is closed or has definitively reached its end.
True if this output is closed or has definitively reached its end. If
isEnded == truethenisWriteable == falseandwritableBytes == 0.- returns
true if it's closed or has definitively reached its end, false otherwise
- Definition Classes
- NiolBuffer → NiolOutput → NiolInput
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
- NiolBuffer → NiolInput
-
def
isWritable: Boolean
* True if a byte can be written to this NiolOutput.
* True if a byte can be written to this NiolOutput.
- returns
true if at least one byte can be written, false otherwise
- Definition Classes
- NiolBuffer → NiolOutput
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
r(): Byte
Reads a byte
Reads a byte
- Definition Classes
- NiolInput
-
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
- NiolBuffer → NiolInput
-
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
- NiolBuffer → NiolInput
-
def
readBool(): Boolean
Reads a boolean.
Reads a boolean.
- Definition Classes
- NiolInput
-
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
-
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
-
def
readBoolean(): Boolean
Reads a boolean
Reads a boolean
- Definition Classes
- NiolInput
-
final
def
readByte(): Byte
Reads a byte
Reads a byte
- Definition Classes
- NiolInput
-
def
readBytes(dst: Array[Byte], offset: Int, length: Int): Unit
Reads the next
lengthbytes and put them intodstat the given offset.Reads the next
lengthbytes and put them intodstat 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
- NiolBuffer → NiolInput
-
def
readBytes(dst: Array[Byte]): Unit
Reads the next
dst.lengthbytes and put them intodst.Reads the next
dst.lengthbytes and put them intodst. Throws an exception if there isn't enough data to fill the array.- dst
the array to fill
- Definition Classes
- NiolInput
-
def
readBytes(n: Int): Array[Byte]
Reads the next
nbytes.Reads the next
nbytes. Throws an Exception if there isn't enough data available.- n
the number of bytes to read
- Definition Classes
- NiolInput
-
def
readChar(): Char
Reads a big-endian char
Reads a big-endian char
- Definition Classes
- NiolInput
-
def
readCharLE(): Char
Reads a little-endian char
Reads a little-endian char
- Definition Classes
- NiolInput
-
final
def
readCharSequence(bytesLength: Int, charset: Charset = UTF_8): CharSequence
Reads the next
bytesLengthbytes as a CharSequence encoded with the given charset.Reads the next
bytesLengthbytes as a CharSequence encoded with the given charset.- Definition Classes
- NiolInput
-
def
readDouble(): Double
Reads a big-endian 8-bytes double
Reads a big-endian 8-bytes double
- Definition Classes
- NiolInput
-
def
readDoubleLE(): Double
Reads a little-endian 8-bytes double
Reads a little-endian 8-bytes double
- Definition Classes
- NiolInput
-
def
readDoubles(dst: Array[Double], offset: Int, length: Int): Unit
Reads the next
lengthdoubles and put them intodstat the given offset.Reads the next
lengthdoubles and put them intodstat 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
-
def
readDoubles(dst: Array[Double]): Unit
Reads the next
dst.lengthdoubles and put them intodst.Reads the next
dst.lengthdoubles and put them intodst. 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
-
def
readDoubles(n: Int): Array[Double]
Reads the next
ndoubles.Reads the next
ndoubles. 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
-
def
readDoublesLE(dst: Array[Double], offset: Int, length: Int): Unit
Reads the next
lengthdoubles and put them intodstat the given offset.Reads the next
lengthdoubles and put them intodstat 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
-
def
readDoublesLE(dst: Array[Double]): Unit
Reads the next
dst.lengthdoubles and put them intodst.Reads the next
dst.lengthdoubles and put them intodst. 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
-
def
readDoublesLE(n: Int): Array[Double]
Reads the next
ndoubles.Reads the next
ndoubles. 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
-
def
readFloat(): Float
Reads a big-endian 4-bytes float
Reads a big-endian 4-bytes float
- Definition Classes
- NiolInput
-
def
readFloatLE(): Float
Reads a little-endian 4-bytes float
Reads a little-endian 4-bytes float
- Definition Classes
- NiolInput
-
def
readFloats(dst: Array[Float], offset: Int, length: Int): Unit
Reads the next
lengthfloats and put them intodstat the given offset.Reads the next
lengthfloats and put them intodstat 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
-
def
readFloats(dst: Array[Float]): Unit
Reads the next
dst.lengthfloats and put them intodst.Reads the next
dst.lengthfloats and put them intodst. 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
-
def
readFloats(n: Int): Array[Float]
Reads the next
nfloats.Reads the next
nfloats. 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
-
def
readFloatsLE(dst: Array[Float], offset: Int, length: Int): Unit
Reads the next
lengthfloats and put them intodstat the given offset.Reads the next
lengthfloats and put them intodstat 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
-
def
readFloatsLE(dst: Array[Float]): Unit
Reads the next
dst.lengthfloats and put them intodst.Reads the next
dst.lengthfloats and put them intodst. 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
-
def
readFloatsLE(n: Int): Array[Float]
Reads the next
nfloats.Reads the next
nfloats. 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
-
def
readInt(): Int
Reads a big-endian 4-bytes integer
Reads a big-endian 4-bytes integer
- Definition Classes
- NiolInput
-
def
readIntLE(): Int
Reads a little-endian 4-bytes integer
Reads a little-endian 4-bytes integer
- Definition Classes
- NiolInput
-
def
readInts(dst: Array[Int], offset: Int, length: Int): Unit
Reads the next
lengthints and put them intodstat the given offset.Reads the next
lengthints and put them intodstat 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
-
def
readInts(dst: Array[Int]): Unit
Reads the next
dst.lengthints and put them intodst.Reads the next
dst.lengthints and put them intodst. 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
-
def
readInts(n: Int): Array[Int]
Reads the next
nints.Reads the next
nints. 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
-
def
readIntsLE(dst: Array[Int], offset: Int, length: Int): Unit
Reads the next
lengthints and put them intodstat the given offset.Reads the next
lengthints and put them intodstat 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
-
def
readIntsLE(dst: Array[Int]): Unit
Reads the next
dst.lengthints and put them intodst.Reads the next
dst.lengthints and put them intodst. 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
-
def
readIntsLE(n: Int): Array[Int]
Reads the next
nints.Reads the next
nints. 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
-
def
readLong(): Long
Reads a big-endian 8-bytes integer
Reads a big-endian 8-bytes integer
- Definition Classes
- NiolInput
-
def
readLongLE(): Long
Reads a little-endian 8-bytes integer
Reads a little-endian 8-bytes integer
- Definition Classes
- NiolInput
-
def
readLongs(dst: Array[Long], offset: Int, length: Int): Unit
Reads the next
lengthlongs and put them intodstat the given offset.Reads the next
lengthlongs and put them intodstat 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
-
def
readLongs(dst: Array[Long]): Unit
Reads the next
dst.lengthlongs and put them intodst.Reads the next
dst.lengthlongs and put them intodst. 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
-
def
readLongs(n: Int): Array[Long]
Reads the next
nlongs.Reads the next
nlongs. 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
-
def
readLongsLE(dst: Array[Long], offset: Int, length: Int): Unit
Reads the next
lengthlongs and put them intodstat the given offset.Reads the next
lengthlongs and put them intodstat 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
-
def
readLongsLE(dst: Array[Long]): Unit
Reads the next
dst.lengthlongs and put them intodst.Reads the next
dst.lengthlongs and put them intodst. 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
-
def
readLongsLE(n: Int): Array[Long]
Reads the next
nlongs.Reads the next
nlongs. 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
-
def
readMedium(): Int
Reads a big-endian 3-bytes integer
Reads a big-endian 3-bytes integer
- Definition Classes
- NiolInput
-
def
readMediumLE(): Int
Reads a little-endian 3-bytes integer
Reads a little-endian 3-bytes integer
- Definition Classes
- NiolInput
-
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
-
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
-
def
readShort(): Short
Reads a big-endian short
Reads a big-endian short
- Definition Classes
- NiolInput
-
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
-
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
-
def
readShortLE(): Short
Reads a little-endian short
Reads a little-endian short
- Definition Classes
- NiolInput
-
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
-
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
-
def
readShorts(dst: Array[Short], offset: Int, length: Int): Unit
Reads the next
lengthshorts and put them intodstat the given offset.Reads the next
lengthshorts and put them intodstat 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
-
def
readShorts(dst: Array[Short]): Unit
Reads the next
dst.lengthshorts and put them intodst.Reads the next
dst.lengthshorts and put them intodst. 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
-
def
readShorts(n: Int): Array[Short]
Reads the next
nshorts.Reads the next
nshorts. 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
-
def
readShortsLE(dst: Array[Short], offset: Int, length: Int): Unit
Reads the next
lengthshorts and put them intodstat the given offset.Reads the next
lengthshorts and put them intodstat 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
-
def
readShortsLE(dst: Array[Short]): Unit
Reads the next
dst.lengthshorts and put them intodst.Reads the next
dst.lengthshorts and put them intodst. 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
-
def
readShortsLE(n: Int): Array[Short]
Reads the next
nshorts.Reads the next
nshorts. 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
-
def
readSome(dst: ByteBuffer): Int
Reads at most
dst.remaining()bytes intodst.Reads at most
dst.remaining()bytes intodst. The buffer's position will be advanced by the number of bytes read from this NiolInput.- dst
the buffer to fill
- Definition Classes
- NiolBuffer → NiolInput
-
def
readSomeBytes(dst: Array[Byte], offset: Int, length: Int): Int
Reads at most
lengthbytes and put them intodstat the given offset.Reads at most
lengthbytes and put them intodstat the given offset. Returns the actual number of bytes read, possibly zero.- dst
the array to fill
- offset
the first index to use
- returns
the number of bytes read
- Definition Classes
- NiolBuffer → NiolInput
-
def
readSomeBytes(dst: Array[Byte]): Int
Reads at most
dst.lengthbytes intodst.Reads at most
dst.lengthbytes intodst. Returns the actual number of bytes read, possibly zero.- dst
the array to fill
- returns
the number of bytes read
- Definition Classes
- NiolInput
-
final
def
readString(bytesLength: Int, charset: Charset = UTF_8): String
Reads the next
bytesLengthbytes as a String encoded with the given charset.Reads the next
bytesLengthbytes as a String encoded with the given charset.- Definition Classes
- NiolInput
-
final
def
readUUID(): UUID
Reads a big-endian 16-bytes UUID
Reads a big-endian 16-bytes UUID
- Definition Classes
- NiolInput
-
final
def
readUnsignedByte(): Int
Reads an unsigned byte as an int
Reads an unsigned byte as an int
- Definition Classes
- NiolInput
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toArray(): Array[Byte]
Reads all the readable bytes of this buffer into a new byte array.
Reads all the readable bytes of this buffer into a new byte array.
- returns
the byte array containing all the bytes read
-
def
toString(): String
- Definition Classes
- NiolBuffer → AnyRef → Any
-
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
-
def
tryWrite(b: Byte): Boolean
Attempts to write a byte.
Attempts to write a byte. Returns false if the output is full.
- b
the byte to write
- returns
true if the byte has been write, false if the output is full
- Definition Classes
- NiolOutput
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
write(src: Array[Byte], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of bytes to write
- Definition Classes
- NiolOutput
-
def
write(src: Array[Byte]): Unit
Writes all the bytes of
src.Writes all the bytes of
src. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
write(src: ByteBuffer): Unit
Writes all of the given ByteBuffer.
Writes all of the given ByteBuffer. Throws an exception if there isn't enough space for the data.
- src
the buffer to write
- Definition Classes
- NiolOutput
-
def
write(b: Byte): Unit
Writes a byte.
-
def
writeBool(bool: Boolean, trueValue: Byte, falseValue: Byte): Unit
Writes a boolean.
Writes a boolean. If it's true, writes
trueValue. If it's false, writesfalseValue.- bool
the boolean to write
- trueValue
the byte to write if the boolean is true
- falseValue
the byte to write if the boolean is false
- Definition Classes
- NiolOutput
-
def
writeBool(bool: Boolean): Unit
Writes a boolean.
Writes a boolean. The default behavior is as follow: If it's true, writes the byte
1. If it's false, writes the byte0.- bool
the boolean to write
- Definition Classes
- NiolOutput
-
def
writeBoolean(boolean: Boolean): Unit
Writes a boolean.
Writes a boolean. The default behavior is as follow: If the value is true, writes the byte
1. If it's false, writes the byte0.- boolean
the boolean to write
- Definition Classes
- NiolOutput
-
def
writeBooleans(src: Array[Boolean], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of booleans to write
- Definition Classes
- NiolOutput
-
def
writeBooleans(src: Array[Boolean]): Unit
Writes all the booleans of
src.Writes all the booleans of
src. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
final
def
writeByte(l: Long): Unit
Writes the least significant byte of a long.
-
final
def
writeByte(i: Int): Unit
Writes the least significant byte of an int.
-
final
def
writeByte(b: Byte): Unit
Writes a byte.
-
final
def
writeChar(c: Char): Unit
Writes a big-endian char.
-
final
def
writeCharLE(c: Char): Unit
Writes a little-endian char.
-
final
def
writeCharSequence(csq: CharSequence, charset: Charset = UTF_8): Unit
Writes a CharSequence with the given charset.
Writes a CharSequence with the given charset. The written data isn't prefixed by its length.
- csq
the value to write
- charset
the charset to encode the CharSequence with
- Definition Classes
- NiolOutput
-
def
writeDouble(d: Double): Unit
Writes a big-endian 8-bytes double.
-
def
writeDoubleLE(d: Double): Unit
Writes a little-endian 8-bytes double.
-
def
writeDoubles(src: Array[Double], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses big-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of doubles to write
- Definition Classes
- NiolOutput
-
def
writeDoubles(src: Array[Double]): Unit
Writes all the doubles of
src.Writes all the doubles of
src. Uses big-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeDoublesLE(src: Array[Double], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses little-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of doubles to write
- Definition Classes
- NiolOutput
-
def
writeDoublesLE(src: Array[Double]): Unit
Writes all the doubles of
src.Writes all the doubles of
src. Uses little-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
final
def
writeFloat(f: Double): Unit
Writes a big-endian 4-bytes float.
-
def
writeFloat(f: Float): Unit
Writes a big-endian 4-bytes float.
-
final
def
writeFloatLE(f: Double): Unit
Writes a little-endian 4-bytes float.
-
def
writeFloatLE(f: Float): Unit
Writes a little-endian 4-bytes float.
-
def
writeFloats(src: Array[Float], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses big-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of floats to write
- Definition Classes
- NiolOutput
-
def
writeFloats(src: Array[Float]): Unit
Writes all the floats of
src.Writes all the floats of
src. Uses big-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeFloatsLE(src: Array[Float], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses little-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of floats to write
- Definition Classes
- NiolOutput
-
def
writeFloatsLE(src: Array[Float]): Unit
Writes all the floats of
src.Writes all the floats of
src. Uses little-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeInt(i: Int): Unit
Writes a big-endian 4-bytes integer.
-
def
writeIntLE(i: Int): Unit
Writes a little-endian 4-bytes integer.
-
def
writeInts(src: Array[Int], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses big-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of ints to write
- Definition Classes
- NiolOutput
-
def
writeInts(src: Array[Int]): Unit
Writes all the ints of
src.Writes all the ints of
src. Uses big-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeIntsLE(src: Array[Int], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses little-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of ints to write
- Definition Classes
- NiolOutput
-
def
writeIntsLE(src: Array[Int]): Unit
Writes all the ints of
src.Writes all the ints of
src. Uses little-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeLong(l: Long): Unit
Writes a big-endian 8-bytes integer.
-
def
writeLongLE(l: Long): Unit
Writes a little-endian 8-bytes integer.
-
def
writeLongs(src: Array[Long], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses big-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of longs to write
- Definition Classes
- NiolOutput
-
def
writeLongs(src: Array[Long]): Unit
Writes all the longs of
src.Writes all the longs of
src. Uses big-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeLongsLE(src: Array[Long], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses little-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of longs to write
- Definition Classes
- NiolOutput
-
def
writeLongsLE(src: Array[Long]): Unit
Writes all the longs of
src.Writes all the longs of
src. Uses little-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeMedium(m: Int): Unit
Writes a big-endian 3-bytes integer.
-
def
writeMediumLE(m: Int): Unit
Writes a little-endian 3-bytes integer.
-
final
def
writeSVarIntZigZag(n: Int): Unit
Writes a variable-length int using the signed/zig-zag encoding.
Writes a variable-length int using the signed/zig-zag encoding.
- n
the value to write
- Definition Classes
- NiolOutput
-
final
def
writeSVarLongZigZag(n: Long): Unit
Writes a variable-length long using the signed/zig-zag encoding.
Writes a variable-length long using the signed/zig-zag encoding.
- n
the value to write
- Definition Classes
- NiolOutput
-
def
writeShort(i: Int): Unit
Writes a big-endian short.
-
final
def
writeShort(s: Short): Unit
Writes a big-endian short.
-
def
writeShortLE(i: Int): Unit
Writes a little-endian short.
-
final
def
writeShortLE(s: Short): Unit
Writes a little-endian short.
-
final
def
writeShortString(csq: CharSequence, charset: Charset = UTF_8): Unit
Writes a CharSequence with the given charset, prefixed by its length written as a big-endian 2-bytes unsigned integer.
Writes a CharSequence with the given charset, prefixed by its length written as a big-endian 2-bytes unsigned integer.
- csq
the value to write
- charset
the charset to encode the CharSequence with
- Definition Classes
- NiolOutput
-
final
def
writeShortStringLE(csq: CharSequence, charset: Charset = UTF_8): Unit
Writes a CharSequence with the given charset, prefixed by its length written as a little-endian 2-bytes unsigned integer.
Writes a CharSequence with the given charset, prefixed by its length written as a little-endian 2-bytes unsigned integer.
- csq
the value to write
- charset
the charset to encode the CharSequence with
- Definition Classes
- NiolOutput
-
def
writeShorts(src: Array[Short], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses big-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of shorts to write
- Definition Classes
- NiolOutput
-
def
writeShorts(src: Array[Short]): Unit
Writes all the shorts of
src.Writes all the shorts of
src. Uses big-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeShortsLE(src: Array[Short], offset: Int, length: Int): Unit
Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1.Writes the content of
src, starting at indexoffsetand ending at indexoffset+length-1. Uses little-endian for each value. Throws an exception if there isn't enough space for the data or if the array index goes out of bounds.- src
the array to write
- offset
the first index to use
- length
the number of shorts to write
- Definition Classes
- NiolOutput
-
def
writeShortsLE(src: Array[Short]): Unit
Writes all the shorts of
src.Writes all the shorts of
src. Uses little-endian for each value. Throws an exception if there isn't enough space for the data.- src
the array to write
- Definition Classes
- NiolOutput
-
def
writeSome(src: Array[Byte], offset: Int, length: Int): Int
Writes at most
lengthbytes ofsrc, starting at indexoffset.Writes at most
lengthbytes ofsrc, starting at indexoffset. Returns the actual number of bytes written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of bytes to write
- returns
the number of bytes written
- Definition Classes
- NiolOutput
-
def
writeSome(src: Array[Byte]): Int
Writes at most
src.lengthbytes ofsrc.Writes at most
src.lengthbytes ofsrc. Returns the actual number of bytes written, possibly zero.- src
the array to write
- returns
the number of bytes written
- Definition Classes
- NiolOutput
-
def
writeSome(src: ByteBuffer): Int
Writes at most
src.remaining()bytes fromsrcinto this output.Writes at most
src.remaining()bytes fromsrcinto this output. The buffer's position will be advanced by the number of bytes written to this NiolOutput.- src
the buffer to write
- Definition Classes
- NiolOutput
-
def
writeSomeBooleans(src: Array[Boolean], offset: Int, length: Int): Int
Writes at most
lengthbooleans ofsrc, starting at indexoffset.Writes at most
lengthbooleans ofsrc, starting at indexoffset. Returns the actual number of booleans written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of booleans to write
- returns
the number of booleans written
- Definition Classes
- NiolOutput
-
def
writeSomeBooleans(src: Array[Boolean]): Int
Writes at most
src.lengthbooleans ofsrc.Writes at most
src.lengthbooleans ofsrc. Returns the actual number of booleans written, possibly zero.- src
the array to write
- returns
the number of booleans written
- Definition Classes
- NiolOutput
-
def
writeSomeDoubles(src: Array[Double], offset: Int, length: Int): Int
Writes at most
lengthdoubles ofsrc, starting at indexoffset.Writes at most
lengthdoubles ofsrc, starting at indexoffset. Uses big-endian for each value. Returns the actual number of doubles written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of doubles to write
- returns
the number of doubles written
- Definition Classes
- NiolOutput
-
def
writeSomeDoubles(src: Array[Double]): Int
Writes at most
src.lengthdoubles ofsrc.Writes at most
src.lengthdoubles ofsrc. Uses big-endian for each value. Returns the actual number of doubles written, possibly zero.- src
the array to write
- returns
the number of doubles written
- Definition Classes
- NiolOutput
-
def
writeSomeDoublesLE(src: Array[Double], offset: Int, length: Int): Int
Writes at most
lengthdoubles ofsrc, starting at indexoffset.Writes at most
lengthdoubles ofsrc, starting at indexoffset. Uses little-endian for each value. Returns the actual number of doubles written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of doubles to write
- returns
the number of doubles written
- Definition Classes
- NiolOutput
-
def
writeSomeDoublesLE(src: Array[Double]): Int
Writes at most
src.lengthdoubles ofsrcfor each value.Writes at most
src.lengthdoubles ofsrcfor each value. Uses little-endian for each value. Returns the actual number of doubles written, possibly zero.- src
the array to write
- returns
the number of doubles written
- Definition Classes
- NiolOutput
-
def
writeSomeFloats(src: Array[Float], offset: Int, length: Int): Int
Writes at most
lengthfloats ofsrc, starting at indexoffset.Writes at most
lengthfloats ofsrc, starting at indexoffset. Uses big-endian for each value. Returns the actual number of floats written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of floats to write
- returns
the number of floats written
- Definition Classes
- NiolOutput
-
def
writeSomeFloats(src: Array[Float]): Int
Writes at most
src.lengthfloats ofsrc.Writes at most
src.lengthfloats ofsrc. Uses big-endian for each value. Returns the actual number of floats written, possibly zero.- src
the array to write
- returns
the number of floats written
- Definition Classes
- NiolOutput
-
def
writeSomeFloatsLE(src: Array[Float], offset: Int, length: Int): Int
Writes at most
lengthfloats ofsrc, starting at indexoffset.Writes at most
lengthfloats ofsrc, starting at indexoffset. Uses little-endian for each value. Returns the actual number of floats written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of floats to write
- returns
the number of floats written
- Definition Classes
- NiolOutput
-
def
writeSomeFloatsLE(src: Array[Float]): Int
Writes at most
src.lengthfloats ofsrcfor each value.Writes at most
src.lengthfloats ofsrcfor each value. Uses little-endian for each value. Returns the actual number of floats written, possibly zero.- src
the array to write
- returns
the number of floats written
- Definition Classes
- NiolOutput
-
def
writeSomeInts(src: Array[Int], offset: Int, length: Int): Int
Writes at most
lengthints ofsrc, starting at indexoffset.Writes at most
lengthints ofsrc, starting at indexoffset. Uses big-endian for each value. Returns the actual number of ints written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of ints to write
- returns
the number of ints written
- Definition Classes
- NiolOutput
-
def
writeSomeInts(src: Array[Int]): Int
Writes at most
src.lengthints ofsrc.Writes at most
src.lengthints ofsrc. Uses big-endian for each value. Returns the actual number of ints written, possibly zero.- src
the array to write
- returns
the number of ints written
- Definition Classes
- NiolOutput
-
def
writeSomeIntsLE(src: Array[Int], offset: Int, length: Int): Int
Writes at most
lengthints ofsrc, starting at indexoffset.Writes at most
lengthints ofsrc, starting at indexoffset. Uses little-endian for each value. Returns the actual number of ints written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of ints to write
- returns
the number of ints written
- Definition Classes
- NiolOutput
-
def
writeSomeIntsLE(src: Array[Int]): Int
Writes at most
src.lengthints ofsrcfor each value.Writes at most
src.lengthints ofsrcfor each value. Uses little-endian for each value. Returns the actual number of ints written, possibly zero.- src
the array to write
- returns
the number of ints written
- Definition Classes
- NiolOutput
-
def
writeSomeLongs(src: Array[Long], offset: Int, length: Int): Int
Writes at most
lengthlongs ofsrc, starting at indexoffset.Writes at most
lengthlongs ofsrc, starting at indexoffset. Uses big-endian for each value. Returns the actual number of longs written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of longs to write
- returns
the number of longs written
- Definition Classes
- NiolOutput
-
def
writeSomeLongs(src: Array[Long]): Int
Writes at most
src.lengthlongs ofsrc.Writes at most
src.lengthlongs ofsrc. Uses big-endian for each value. Returns the actual number of longs written, possibly zero.- src
the array to write
- returns
the number of longs written
- Definition Classes
- NiolOutput
-
def
writeSomeLongsLE(src: Array[Long], offset: Int, length: Int): Int
Writes at most
lengthlongs ofsrc, starting at indexoffset.Writes at most
lengthlongs ofsrc, starting at indexoffset. Uses little-endian for each value. Returns the actual number of longs written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of longs to write
- returns
the number of longs written
- Definition Classes
- NiolOutput
-
def
writeSomeLongsLE(src: Array[Long]): Int
Writes at most
src.lengthlongs ofsrcfor each value.Writes at most
src.lengthlongs ofsrcfor each value. Uses little-endian for each value. Returns the actual number of longs written, possibly zero.- src
the array to write
- returns
the number of longs written
- Definition Classes
- NiolOutput
-
def
writeSomeShorts(src: Array[Short], offset: Int, length: Int): Int
Writes at most
lengthshorts ofsrc, starting at indexoffset.Writes at most
lengthshorts ofsrc, starting at indexoffset. Uses big-endian for each value. Returns the actual number of shorts written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of shorts to write
- returns
the number of shorts written
- Definition Classes
- NiolOutput
-
def
writeSomeShorts(src: Array[Short]): Int
Writes at most
src.lengthshorts ofsrc.Writes at most
src.lengthshorts ofsrc. Uses big-endian for each value. Returns the actual number of shorts written, possibly zero.- src
the array to write
- returns
the number of shorts written
- Definition Classes
- NiolOutput
-
def
writeSomeShortsLE(src: Array[Short], offset: Int, length: Int): Int
Writes at most
lengthshorts ofsrc, starting at indexoffset.Writes at most
lengthshorts ofsrc, starting at indexoffset. Uses little-endian for each value. Returns the actual number of shorts written, possibly zero.- src
the array to write
- offset
the first index to use
- length
the number of shorts to write
- returns
the number of shorts written
- Definition Classes
- NiolOutput
-
def
writeSomeShortsLE(src: Array[Short]): Int
Writes at most
src.lengthshorts ofsrcfor each value.Writes at most
src.lengthshorts ofsrcfor each value. Uses little-endian for each value. Returns the actual number of shorts written, possibly zero.- src
the array to write
- returns
the number of shorts written
- Definition Classes
- NiolOutput
-
final
def
writeString(str: String, charset: Charset = UTF_8): Unit
Writes a String with the given charset.
Writes a String with the given charset. The written data isn't prefixed by its length.
- str
the value to write
- charset
the charset to encode the String with
- Definition Classes
- NiolOutput
-
final
def
writeUUID(uuid: UUID): Unit
Writes a UUID as two 8-bytes big-endian integers, most significant bits first.
Writes a UUID as two 8-bytes big-endian integers, most significant bits first.
- uuid
the value to write
- Definition Classes
- NiolOutput
-
def
writeVarInt(i: Int): Unit
Writes a variable-length int using the normal/unsigned encoding.
Writes a variable-length int using the normal/unsigned encoding.
- i
the value to write
- Definition Classes
- NiolOutput
-
def
writeVarLong(l: Long): Unit
Writes a variable-length long using the normal/unsigned encoding.
Writes a variable-length long using the normal/unsigned encoding.
- l
the value to write
- Definition Classes
- NiolOutput
-
final
def
writeVarString(csq: CharSequence, charset: Charset = UTF_8): Unit
Writes a CharSequence with the given charset, preceded by its length written as a normal VarInt.
Writes a CharSequence with the given charset, preceded by its length written as a normal VarInt.
- csq
the value to write
- charset
the charset to CharSequence the String with
- Definition Classes
- NiolOutput