Package de.xima.fc.common.io
Class MarkableNullInputStream
- java.lang.Object
-
- java.io.InputStream
-
- de.xima.fc.common.io.MarkableNullInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class MarkableNullInputStream extends InputStream
AnInputStreamthat is always empty and markable / resettable.InputStream.nullInputStream()is not markable, this one is. Some use cases such as the ICU4J library require markable input streams.- Since:
- 8.3.0
- Author:
- XIMA Media GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readLimit)static InputStreammarkableNullInputStream()Gets a new instance of a markable null input stream.booleanmarkSupported()intread()intread(byte[] b, int off, int len)byte[]readAllBytes()intreadNBytes(byte[] b, int off, int len)byte[]readNBytes(int len)voidreset()longskip(long n)longtransferTo(OutputStream out)-
Methods inherited from class java.io.InputStream
nullInputStream, read
-
-
-
-
Method Detail
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readLimit)
- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
readAllBytes
public byte[] readAllBytes() throws IOException- Overrides:
readAllBytesin classInputStream- Throws:
IOException
-
readNBytes
public int readNBytes(byte[] b, int off, int len) throws IOException- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
readNBytes
public byte[] readNBytes(int len) throws IOException- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
transferTo
public long transferTo(OutputStream out) throws IOException
- Overrides:
transferToin classInputStream- Throws:
IOException
-
markableNullInputStream
public static InputStream markableNullInputStream()
Gets a new instance of a markable null input stream.- Returns:
- A new instance of a markable null input stream.
-
-