ZeroCopyByteStringUtil (Cloud Bigtable HBase Client for Java 1.12.0 API)

Class ZeroCopyByteStringUtil

  • public final class ZeroCopyByteStringUtil
    extends Object
    Helper class to extract byte arrays from ByteString without copy.

    Without this protobufs would force us to copy every single byte array out of the objects de-serialized from the wire (which already do one copy, on top of the copies the JVM does to go from kernel buffer to C buffer and from C buffer to JVM buffer).

    $Id: $Id
    • Constructor Detail

      • ZeroCopyByteStringUtil

        public ZeroCopyByteStringUtil()
    • Method Detail

      • wrap

        public static ByteString wrap(byte[] array)
        Wraps a byte array in a ByteString without copying it.
        array - an array of byte.
        a ByteString object.
      • get

        public static byte[] get(ByteString byteString)
        Extracts the byte array from the given ByteString without copy.
        byteString - A ByteString from which to extract the array.
        an array of byte.

क्या यह पेज उपयोगी था? हमारे काम के बारे में अपनी राय दें:

निम्न के बारे में फ़ीडबैक भेजें...