Class DhProtoUtil

java.lang.Object
com.google.protobuf.DhProtoUtil

public class DhProtoUtil extends Object
  • Constructor Details

    • DhProtoUtil

      public DhProtoUtil()
  • Method Details

    • wrapAsByteString

      public static com.google.protobuf.ByteString wrapAsByteString(byte[] bs)
      Wrap as a ByteString a provided byte array, taking ownership of it.
      Parameters:
      bs - A byte array to wrap as a ByteString. Note the implementation takes ownership of the provided array.
      Returns:
      a ByteString wrapping the provided array.
    • wrapAsByteString

      public static com.google.protobuf.ByteString wrapAsByteString(byte[] bs, int offset, int length)
      Wrap as a ByteString a provided byte array, taking ownership of it.
      Parameters:
      bs - A byte array to wrap as a ByteString. Note the implementation takes ownership of the provided array.
      offset - the position offset in the byte array provided, to start from.
      length - the length in bytes from the position offset to use.
      Returns:
      a ByteString wrapping the provided array.
    • decodeUtf8

      public static String decodeUtf8(byte[] bytes, int index, int size) throws com.google.protobuf.InvalidProtocolBufferException
      Decodes the given UTF-8 encoded byte array slice into a String.
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - if the input is not valid UTF-8.
    • truncatedMessage

      public static com.google.protobuf.InvalidProtocolBufferException truncatedMessage()
    • negativeSize

      public static com.google.protobuf.InvalidProtocolBufferException negativeSize()
    • malformedVarint

      public static com.google.protobuf.InvalidProtocolBufferException malformedVarint()
    • invalidTag

      public static com.google.protobuf.InvalidProtocolBufferException invalidTag()
    • invalidEndTag

      public static com.google.protobuf.InvalidProtocolBufferException invalidEndTag()
    • invalidWireType

      public static com.google.protobuf.InvalidProtocolBufferException invalidWireType()
    • recursionLimitExceeded

      public static com.google.protobuf.InvalidProtocolBufferException recursionLimitExceeded()
    • sizeLimitExceeded

      public static com.google.protobuf.InvalidProtocolBufferException sizeLimitExceeded()
    • byteStringToHex

      public static String byteStringToHex(com.google.protobuf.ByteString bstr)
    • byteArrayToHex

      public static String byteArrayToHex(byte[] bs)