Class JSONDecoder


  • public class JSONDecoder
    extends Decoder<java.lang.Object>
    JSON decoder.
    • Field Summary

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

        EOF
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONDecoder()
      Constructs a new JSON decoder.
      JSONDecoder​(boolean sorted)
      Constructs a new JSON decoder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <U> 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

      • JSONDecoder

        public JSONDecoder()
        Constructs a new JSON decoder.
      • JSONDecoder

        public JSONDecoder​(boolean sorted)
        Constructs a new JSON decoder.
        Parameters:
        sorted - true if the decoded output should be sorted by key; false, otherwise.
    • Method Detail

      • read

        public <U> 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.Object>
        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.