zstan commented on code in PR #13634:
URL: https://github.com/apache/ignite/pull/13634#discussion_r4153032593
##########
modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinTcpIo.java:
##########
@@ -593,23 +594,25 @@ private void sendRequestRaw(JdbcRequest req) throws
IOException {
req.writeBinary(writer, protoCtx);
synchronized (connMux) {
- send(writer.out().arrayCopy());
+ send(writer);
}
}
/**
- * @param req JDBC request bytes.
+ * @param writer Writer with request bytes.
* @throws IOException On error.
*/
- private void send(byte[] req) throws IOException {
- int size = req.length;
+ private void send(BinaryWriterEx writer) throws IOException {
+ BinaryOutputStream stream = writer.out();
+
+ int size = stream.position();
out.write(size & 0xFF);
out.write((size >> 8) & 0xFF);
out.write((size >> 16) & 0xFF);
out.write((size >> 24) & 0xFF);
- out.write(req);
+ out.write(stream.array(), 0, stream.position());
Review Comment:
```suggestion
out.write(stream.array(), 0, size);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]