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
- Author:
- Sergey Shemyakov
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionASBufferingOutFilter(ASOutputStream stream) ASBufferingOutFilter(ASOutputStream stream, int bufferCapacity) -
Method Summary
Modifier and TypeMethodDescriptionintbufferRewind(int offset) Moves buffer writer pointer back by given number of bytes.intvoidclose()intintintvoidstoreChar(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
-
Field Details
-
internalBuffer
protected byte[] internalBuffer
-
-
Constructor Details
-
ASBufferingOutFilter
-
ASBufferingOutFilter
-
-
Method Details
-
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.
-