Class TextDecoder


  • public class TextDecoder
    extends Decoder<java.lang.CharSequence>
    Text decoder.
    • Field Summary

      • Fields inherited from class org.httprpc.io.Decoder

        EOF
    • Constructor Summary

      Constructors 
      Constructor Description
      TextDecoder()
      Constructs a new text decoder.
      TextDecoder​(java.nio.charset.Charset charset)
      Constructs a new text decoder.
      TextDecoder​(java.nio.charset.Charset charset, boolean builder)
      Constructs a new text decoder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <U extends java.lang.CharSequence>
      U
      read​(java.io.Reader reader)
      Reads a value from a character stream.
      • Methods inherited from class java.lang.Object

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

      • TextDecoder

        public TextDecoder()
        Constructs a new text decoder.
      • TextDecoder

        public TextDecoder​(java.nio.charset.Charset charset)
        Constructs a new text decoder.
        Parameters:
        charset - The character set to use when decoding the text.
      • TextDecoder

        public TextDecoder​(java.nio.charset.Charset charset,
                           boolean builder)
        Constructs a new text decoder.
        Parameters:
        charset - The character set to use when decoding the text.
        builder - true if the result should be returned as a mutable builder; false, otherwise.
    • Method Detail

      • read

        public <U extends java.lang.CharSequence> U read​(java.io.Reader reader)
                                                  throws java.io.IOException
        Description copied from class: Decoder
        Reads a value from a character stream.
        Specified by:
        read in class Decoder<java.lang.CharSequence>
        Type Parameters:
        U - The decoded value type.
        Parameters:
        reader - The character stream to read from.
        Returns:
        The decoded value.
        Throws:
        java.io.IOException - If an exception occurs.