diff --git a/gradle.properties b/gradle.properties index c980a9f..e892bb1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=2.9.16 +projectVersion=2.9.17 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt b/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt index 5b4e5b5..cd07670 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt @@ -316,6 +316,12 @@ fun OutputStream.writeByteArray(value: ByteArray) { write(value) } +fun OutputStream.writeByteArray(value: ByteArray, offset: Int, length: Int) { + Objects.checkFromIndexSize(offset, value.size, length) + writeVarInt(length) + write(value, offset, length) +} + fun OutputStream.writeByteKey(key: ByteKey) { key.write(this) }