Package org.verapdf.as.filters.io
Class ASBufferingOutFilter
- java.lang.Object
-
- org.verapdf.as.filters.ASOutFilter
-
- org.verapdf.as.filters.io.ASBufferingOutFilter
-
- All Implemented Interfaces:
ASOutputStream
- Direct Known Subclasses:
COSFilterFlateEncode
public class ASBufferingOutFilter extends ASOutFilter
- Author:
- Sergey Shemyakov
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]internalBuffer
-
Constructor Summary
Constructors Constructor Description ASBufferingOutFilter(ASOutputStream stream)ASBufferingOutFilter(ASOutputStream stream, int bufferCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbufferRewind(int offset)Moves buffer writer pointer back by given number of bytes.intbufferSize()voidclose()intgetBufferCapacity()intgetBufferEnd()intgetBufferWriter()voidstoreChar(byte b)Stores character to current writer position and increments writer position.-
Methods inherited from class org.verapdf.as.filters.ASOutFilter
getStoredOutputStream, write, write, write
-
-
-
-
Constructor Detail
-
ASBufferingOutFilter
public ASBufferingOutFilter(ASOutputStream stream)
-
ASBufferingOutFilter
public ASBufferingOutFilter(ASOutputStream stream, int bufferCapacity)
-
-
Method Detail
-
close
public void close()
Description copied from class:ASOutFilter- Specified by:
closein interfaceASOutputStream- Overrides:
closein classASOutFilter
-
getBufferWriter
public int getBufferWriter()
- Returns:
- the index of current write position.
-
getBufferEnd
public int getBufferEnd()
- Returns:
- the index of the end of the buffer.
-
getBufferCapacity
public int getBufferCapacity()
- Returns:
- the total capacity of buffer.
-
bufferSize
public int bufferSize()
- Returns:
- number of bytes actually present in the buffer.
-
storeChar
public void storeChar(byte b)
Stores character to current writer position and increments writer position. For better performance does not check buffer overflow, use with care.- Parameters:
b- is character to be put into buffer.
-
bufferRewind
public int bufferRewind(int offset)
Moves buffer writer pointer back by given number of bytes.- Parameters:
offset- is number of bytes on which we should move pointer.- Returns:
- actual amount of bytes on which pointer was moved.
-
-