Class ZeroCopyByteString


  • public class ZeroCopyByteString
    extends java.lang.Object
    Use this as a way to use existing byte arrays when converting to ByteString for protobuf conversion. Critical to remember that if the backing byte[] mutates, so does your ByteString.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ByteString wrap​(byte[] bytes)  
      static ByteString wrap​(byte[] bytes, int offset, int length)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZeroCopyByteString

        public ZeroCopyByteString()
    • Method Detail

      • wrap

        public static ByteString wrap​(@Nonnull
                                      byte[] bytes)
      • wrap

        public static ByteString wrap​(@Nonnull
                                      byte[] bytes,
                                      int offset,
                                      int length)