Package yapion.io

Class YAPIONInputStream

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class YAPIONInputStream
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Constructor Summary

      Constructors 
      Constructor Description
      YAPIONInputStream​(java.io.InputStream inputStream)
      Creates a YAPIONInputStream from an InputStream.
    • Method Summary

      Modifier and Type Method Description
      int available()  
      void close()
      Closes the InputStream.
      YAPIONObject read()
      Read and parses the next YAPIONObject.
      int readByte()  
      java.lang.Object readObject()
      Reads, parses and deserializes the next YAPIONObject.
      java.lang.Object readObject​(TypeReMapper typeReMapper)
      Reads, parses and deserializes the next YAPIONObject.
      long skip​(long skip)  
      • Methods inherited from class java.lang.Object

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

      • YAPIONInputStream

        public YAPIONInputStream​(java.io.InputStream inputStream)
        Creates a YAPIONInputStream from an InputStream. It is encouraged to input some kind of BufferedInputStream. This will increase the read() speed tremendously.
        Parameters:
        inputStream - the InputStream
    • Method Detail

      • available

        public int available()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • readByte

        public int readByte()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • skip

        public long skip​(long skip)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Closes the InputStream.
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException - by InputStream.close()
      • read

        public YAPIONObject read()
        Read and parses the next YAPIONObject.
        Returns:
        the next YAPIONObject
        Throws:
        YAPIONIOException - if the inputStream was closed
      • readObject

        public java.lang.Object readObject()
        Reads, parses and deserializes the next YAPIONObject.
        Returns:
        the next Object
        Throws:
        YAPIONIOException - if the inputStream was closed
      • readObject

        public java.lang.Object readObject​(TypeReMapper typeReMapper)
        Reads, parses and deserializes the next YAPIONObject.
        Parameters:
        typeReMapper - the TypeReMapper to use
        Returns:
        the next Object
        Throws:
        YAPIONIOException - if the inputStream was closed