ZeroCopyByteStringUtil (Cloud Bigtable HBase Client for Java 0.9.7.1 API)

com.google.cloud.bigtable.util

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).

    Version:
    $Id: $Id
    Author:
    sduskis
    • Constructor Detail

      • ZeroCopyByteStringUtil

        public ZeroCopyByteStringUtil()
    • Method Detail

      • wrap

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

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


Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Bigtable Documentation