Add docs to writeByteArray
This commit is contained in:
parent
786dcfbe53
commit
e189009494
@ -311,11 +311,17 @@ fun <S : OutputStream, V : Any> S.writeOptional(value: Optional<V>, writer: S.(V
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes array's size as variable length integer and then writes its contents
|
||||||
|
*/
|
||||||
fun OutputStream.writeByteArray(value: ByteArray) {
|
fun OutputStream.writeByteArray(value: ByteArray) {
|
||||||
writeVarInt(value.size)
|
writeVarInt(value.size)
|
||||||
write(value)
|
write(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes array's size as variable length integer and then writes its contents
|
||||||
|
*/
|
||||||
fun OutputStream.writeByteArray(value: ByteArray, offset: Int, length: Int) {
|
fun OutputStream.writeByteArray(value: ByteArray, offset: Int, length: Int) {
|
||||||
Objects.checkFromIndexSize(offset, value.size, length)
|
Objects.checkFromIndexSize(offset, value.size, length)
|
||||||
writeVarInt(length)
|
writeVarInt(length)
|
||||||
|
Loading…
Reference in New Issue
Block a user