Interface CachedEncoder

All Superinterfaces:
Encoder
All Known Subinterfaces:
PatchEncoder
All Known Implementing Classes:
PackedEncodeOverlay, PatchPackedEncode, XmlEncode

public interface CachedEncoder extends Encoder
An Encoder that holds its bytes in memory (where they can possibly be edited) and can then finally write them all to an OutputStream via a call to writeTo()
  • Method Details

    • clear

      void clear()
      Clear any state associated with the encoder The encoder should be ready to write a new document after this call.
    • isEmpty

      boolean isEmpty()
      The encoder is considered empty if the writeTo() method would output zero bytes
      Returns:
      true if there are no bytes in the encoder
    • writeTo

      void writeTo(OutputStream stream) throws IOException
      Dump all the accumulated bytes in this encoder to the stream.
      Parameters:
      stream - is the output stream
      Throws:
      IOException - for errors during the write operation