Class MarkableNullInputStream
java.lang.Object
java.io.InputStream
de.xima.fc.common.io.MarkableNullInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
An
InputStream that 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
Modifier and TypeMethodDescriptionintvoidclose()voidmark(int readLimit) static InputStreamGets a new instance of a markable null input stream.booleanintread()intread(byte[] b, int off, int len) byte[]intreadNBytes(byte[] b, int off, int len) byte[]readNBytes(int len) voidreset()longskip(long n) longtransferTo(OutputStream out) Methods inherited from class InputStream
nullInputStream, read
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- 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
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
readAllBytes
- Overrides:
readAllBytesin classInputStream- Throws:
IOException
-
readNBytes
- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
readNBytes
- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
transferTo
- Overrides:
transferToin classInputStream- Throws:
IOException
-
markableNullInputStream
Gets a new instance of a markable null input stream.- Returns:
- A new instance of a markable null input stream.
-