Package yapion.io
Class YAPIONInputStream
- java.lang.Object
-
- yapion.io.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)
-
-
-
Constructor Detail
-
YAPIONInputStream
public YAPIONInputStream(java.io.InputStream inputStream)
Creates a YAPIONInputStream from an InputStream. It is encouraged to input some kind ofBufferedInputStream
. This will increase theread()
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 interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
- byInputStream.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
- theTypeReMapper
to use- Returns:
- the next Object
- Throws:
YAPIONIOException
- if the inputStream was closed
-
-