From e189009494c1e7cce884fa126a99131b5974900d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 3 Mar 2024 16:42:13 +0700 Subject: [PATCH] Add docs to writeByteArray --- .../kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt b/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt index cd07670..75fc06e 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt @@ -311,11 +311,17 @@ fun S.writeOptional(value: Optional, writer: S.(V } } +/** + * Writes array's size as variable length integer and then writes its contents + */ fun OutputStream.writeByteArray(value: ByteArray) { writeVarInt(value.size) write(value) } +/** + * Writes array's size as variable length integer and then writes its contents + */ fun OutputStream.writeByteArray(value: ByteArray, offset: Int, length: Int) { Objects.checkFromIndexSize(offset, value.size, length) writeVarInt(length)