We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6492294 commit 8b47ca5Copy full SHA for 8b47ca5
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/codec/ByteArrayInputStreamCodec.java
@@ -86,16 +86,13 @@ public Mono<ByteBuf> publishBinary(ByteBufAllocator allocator) {
86
87
try {
88
VarIntUtils.writeVarInt(buf, size);
89
-
90
- byte[] byteArray = new byte[size];
91
- int readBytes = value.read(byteArray);
92
+ int readBytes = buf.writeBytes(value, size);
93
if (readBytes != size) {
94
buf.release();
95
throw new IllegalStateException("Expected to read " + size + " bytes, but got " + readBytes);
96
}
97
98
- return buf.writeBytes(byteArray);
+ return buf;
99
} catch (Exception e) {
100
101
throw new RuntimeException(e);
0 commit comments