Skip to content

Commit cc6be0b

Browse files
authored
Merge pull request #582 from fishisnow/feature/ClickhouseBinaryStream_add_functions
Feat: ClickHouseRowBinaryStream add writeBytes function
2 parents 9be5e87 + 28e6e99 commit cc6be0b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clickhouse-jdbc/src/main/java/ru/yandex/clickhouse/util/ClickHouseRowBinaryStream.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ public void writeByteBuffer(ByteBuffer buffer) throws IOException {
6666
Channels.newChannel(out).write(buffer);
6767
}
6868

69+
/**
70+
* @param bytes byte array will be written into stream
71+
* @param offset the starting offset in {@code bytes} to start writing at
72+
* @param len the length of the {@code bytes}, starting from {@code offset}
73+
* @throws IOException in case if an I/O error occurs
74+
*/
75+
public void writeBytes(byte[] bytes, int offset, int len) throws IOException {
76+
out.write(bytes, offset, len);
77+
}
78+
6979
/**
7080
* Dangerous. Can only be used for rare optimizations, for example when the string is written in parts
7181
* without prior concatenation. The size of the string in bytes must be passed through writeUnsignedLeb128.

0 commit comments

Comments
 (0)