Package io.grpc

Class Status.StatusMessageMarshaller

java.lang.Object
io.grpc.Status.StatusMessageMarshaller
All Implemented Interfaces:
Metadata.TrustedAsciiMarshaller<String>
Enclosing class:
Status

private static final class Status.StatusMessageMarshaller extends Object implements Metadata.TrustedAsciiMarshaller<String>
  • Field Details

    • HEX

      private static final byte[] HEX
  • Constructor Details

    • StatusMessageMarshaller

      private StatusMessageMarshaller()
  • Method Details

    • toAsciiString

      public byte[] toAsciiString(String value)
      Description copied from interface: Metadata.TrustedAsciiMarshaller
      Serialize a metadata value to a ASCII string that contains only the characters listed in the class comment of Metadata.AsciiMarshaller. Otherwise the output may be considered invalid and discarded by the transport, or the call may fail.
      Specified by:
      toAsciiString in interface Metadata.TrustedAsciiMarshaller<String>
      Parameters:
      value - to serialize
      Returns:
      serialized version of value, or null if value cannot be transmitted.
    • isEscapingChar

      private static boolean isEscapingChar(byte b)
    • toAsciiStringSlow

      private static byte[] toAsciiStringSlow(byte[] valueBytes, int ri)
      Percent encode bytes to make them ASCII.
      Parameters:
      valueBytes - the UTF-8 bytes
      ri - The reader index, pointed at the first byte that needs escaping.
    • parseAsciiString

      public String parseAsciiString(byte[] value)
      Description copied from interface: Metadata.TrustedAsciiMarshaller
      Parse a serialized metadata value from an ASCII string.
      Specified by:
      parseAsciiString in interface Metadata.TrustedAsciiMarshaller<String>
      Parameters:
      value - value of metadata to parse
      Returns:
      a parsed instance of type T
    • parseAsciiStringSlow

      private static String parseAsciiStringSlow(byte[] value)