Skip to content

Commit 416fee2

Browse files
committed
use ObByteBuf to reduce allocate tmp byte array
1 parent f798601 commit 416fee2

16 files changed

+520
-30
lines changed

src/main/java/com/alipay/oceanbase/rpc/protocol/payload/AbstractPayload.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.alipay.oceanbase.rpc.protocol.payload;
1919

20+
import com.alipay.oceanbase.rpc.util.ObByteBuf;
2021
import com.alipay.oceanbase.rpc.util.Serialization;
2122
import io.netty.buffer.ByteBuf;
2223

@@ -184,4 +185,8 @@ protected int encodeHeader(byte[] bytes, int idx) {
184185
return idx;
185186
}
186187

188+
protected void encodeHeader(ObByteBuf buf) {
189+
encodeObUniVersionHeader(buf, getVersion(), getPayloadContentSize());
190+
}
191+
187192
}

0 commit comments

Comments
 (0)