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 Details

    • internalBuffer

      protected byte[] internalBuffer
  • Constructor Details

    • ASBufferingOutFilter

      public ASBufferingOutFilter(ASOutputStream stream)
    • ASBufferingOutFilter

      public ASBufferingOutFilter(ASOutputStream stream, int bufferCapacity)
  • Method Details

    • close

      public void close()
      Description copied from class: ASOutFilter
      Specified by:
      close in interface ASOutputStream
      Overrides:
      close in class ASOutFilter
    • 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.