Package io.grpc

Class Status.StatusMessageMarshaller

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte[] HEX  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean isEscapingChar​(byte b)  
      java.lang.String parseAsciiString​(byte[] value)
      Parse a serialized metadata value from an ASCII string.
      private static java.lang.String parseAsciiStringSlow​(byte[] value)  
      byte[] toAsciiString​(java.lang.String value)
      Serialize a metadata value to a ASCII string that contains only the characters listed in the class comment of Metadata.AsciiMarshaller.
      private static byte[] toAsciiStringSlow​(byte[] valueBytes, int ri)
      Percent encode bytes to make them ASCII.
      • Methods inherited from class java.lang.Object

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

      • HEX

        private static final byte[] HEX
    • Constructor Detail

      • StatusMessageMarshaller

        private StatusMessageMarshaller()
    • Method Detail

      • toAsciiString

        public byte[] toAsciiString​(java.lang.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<java.lang.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.
      • parseAsciiStringSlow

        private static java.lang.String parseAsciiStringSlow​(byte[] value)