Public Member Functions | |
byte[] | copyFrom (byte[] bytes, int offset, int size) |
byte[] | copyFrom (byte[] bytes, int offset, int size) |
An interface to efficiently copy
.
One of the noticeable costs of copying a byte[] into a new array using
is nullification of a new buffer before the copy. It has been shown the Hotspot VM is capable to intrisicfy
operation to avoid this expensive nullification and provide substantial performance gain. Unfortunately this does not hold on Android runtimes and could make the copy slightly slower due to additional code in the
. Thus we provide two different implementation for array copier for Hotspot and Android runtimes.
Definition at line 98 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/ByteString.java.
byte [] com.google.protobuf.ByteString.ByteArrayCopier.copyFrom | ( | byte[] | bytes, |
int | offset, | ||
int | size | ||
) |
Copies the specified range of the specified array into a new array
Implemented in com.google.protobuf.ByteString.ArraysByteArrayCopier, com.google.protobuf.ByteString.ArraysByteArrayCopier, com.google.protobuf.ByteString.SystemByteArrayCopier, and com.google.protobuf.ByteString.SystemByteArrayCopier.
byte [] com.google.protobuf.ByteString.ByteArrayCopier.copyFrom | ( | byte[] | bytes, |
int | offset, | ||
int | size | ||
) |
Copies the specified range of the specified array into a new array
Implemented in com.google.protobuf.ByteString.ArraysByteArrayCopier, com.google.protobuf.ByteString.ArraysByteArrayCopier, com.google.protobuf.ByteString.SystemByteArrayCopier, and com.google.protobuf.ByteString.SystemByteArrayCopier.