Package org.verapdf.as.io
Class ASInputStreamWrapper
- java.lang.Object
-
- java.io.InputStream
-
- org.verapdf.as.io.ASInputStream
-
- org.verapdf.as.io.ASInputStreamWrapper
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ASInputStreamWrapper extends ASInputStream
Class represents ASInputStream that can be constructed from another ASInputStream.- Author:
- Sergey Shemyakov
-
-
Field Summary
-
Fields inherited from class org.verapdf.as.io.ASInputStream
isClosed, isSourceClosed, resourceUsers
-
-
Constructor Summary
Constructors Constructor Description ASInputStreamWrapper(ASInputStream stream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcloseResource()Closes stream resource.voiddecrementResourceUsers()Method decrements number of resource users.voidincrementResourceUsers()Method increments number of resource users.intread()intread(byte[] buffer, int size)intread(byte[] b, int off, int len)voidreset()intskip(int size)-
Methods inherited from class org.verapdf.as.io.ASInputStream
createStreamFromStream
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Constructor Detail
-
ASInputStreamWrapper
public ASInputStreamWrapper(ASInputStream stream)
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classASInputStream- Throws:
IOException
-
read
public int read(byte[] buffer, int size) throws IOException- Specified by:
readin classASInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
skip
public int skip(int size) throws IOException- Specified by:
skipin classASInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Specified by:
resetin classASInputStream- Throws:
IOException
-
closeResource
public void closeResource() throws IOExceptionDescription copied from class:ASInputStreamCloses stream resource. There is a difference between closing stream and closing it's resource. Several streams may have the same resource (e. g. the same file stream) and resource should be closed only after all streams using it are closed.- Specified by:
closeResourcein classASInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classASInputStream- Throws:
IOException
-
incrementResourceUsers
public void incrementResourceUsers()
Description copied from class:ASInputStreamMethod increments number of resource users. {@see closeResource}- Specified by:
incrementResourceUsersin classASInputStream
-
decrementResourceUsers
public void decrementResourceUsers()
Description copied from class:ASInputStreamMethod decrements number of resource users. {@see closeResource}- Specified by:
decrementResourceUsersin classASInputStream
-
-