Package org.verapdf.as.filters
Class ASInFilter
- java.lang.Object
-
- java.io.InputStream
-
- org.verapdf.as.io.ASInputStream
-
- org.verapdf.as.filters.ASInFilter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
ASBufferedInFilter
public abstract class ASInFilter extends ASInputStream
Base class for input filters.- Author:
- Timur Kamalov
-
-
Field Summary
-
Fields inherited from class org.verapdf.as.io.ASInputStream
isClosed, isSourceClosed, resourceUsers
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ASInFilter(ASInFilter filter)
protected
ASInFilter(ASInputStream inputStream)
Constructor from encoded stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
closeResource()
Closes stream resource.void
decrementResourceUsers()
Method decrements number of resource users.protected ASInputStream
getInputStream()
void
incrementResourceUsers()
Method increments number of resource users.int
read()
int
read(byte[] buffer)
int
read(byte[] buffer, int size)
void
reset()
protected void
setInputStream(ASInputStream inputStream)
int
skip(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
-
ASInFilter
protected ASInFilter(ASInputStream inputStream)
Constructor from encoded stream.- Parameters:
inputStream
- is stream with initial encoded data.- Throws:
IOException
-
ASInFilter
protected ASInFilter(ASInFilter filter)
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classASInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer, int size) throws IOException
- Specified by:
read
in classASInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public int skip(int size) throws IOException
- Specified by:
skip
in classASInputStream
- Throws:
IOException
-
closeResource
public void closeResource() throws IOException
Description copied from class:ASInputStream
Closes 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:
closeResource
in classASInputStream
- Throws:
IOException
-
reset
public void reset() throws IOException
- Specified by:
reset
in classASInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classASInputStream
- Throws:
IOException
-
getInputStream
protected ASInputStream getInputStream()
-
setInputStream
protected void setInputStream(ASInputStream inputStream)
-
incrementResourceUsers
public void incrementResourceUsers()
Method increments number of resource users. {@see closeResource}- Specified by:
incrementResourceUsers
in classASInputStream
-
decrementResourceUsers
public void decrementResourceUsers()
Description copied from class:ASInputStream
Method decrements number of resource users. {@see closeResource}- Specified by:
decrementResourceUsers
in classASInputStream
-
-