Skip to content

Commit

Permalink
no FUD
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
Adrian Cole committed Mar 1, 2024
1 parent 8c4962b commit 79c0b92
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions util/src/main/java/io/kubernetes/client/ProtoClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,7 @@ private static byte[] encode(Message msg, String apiVersion, String kind) throws
.setRaw(msg.toByteString())
.build();

// Encode directly to an array, to reduce buffering. CodedOutputStream will
// still allocate arrays internally, but this is the best we can do without
// something that quickly looks like square/wire.
// Encode directly to a sized array, to eliminate buffering
int serializedSize = u.getSerializedSize();
byte[] result = new byte[MAGIC.length + u.getSerializedSize()];
System.arraycopy(MAGIC, 0, result, 0, MAGIC.length);
Expand Down

0 comments on commit 79c0b92

Please sign in to comment.