Class AbstractEncodingFilterOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
edu.vt.middleware.crypt.io.AbstractEncodingFilterOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Direct Known Subclasses:
Base64FilterOutputStream, HexFilterOutputStream

public abstract class AbstractEncodingFilterOutputStream extends FilterOutputStream
Abstract base class for filter output streams that convert raw bytes into encoded characters.
Version:
$Revision: 2744 $
Author:
Middleware Services
  • Constructor Details

    • AbstractEncodingFilterOutputStream

      protected AbstractEncodingFilterOutputStream(OutputStream out)
      Creates an output filter that encodes raw bytes into encoded character bytes in the wrapped output stream.
      Parameters:
      out - Output stream to wrap.
  • Method Details

    • write

      public void write(int b) throws IOException
      Overrides:
      write in class FilterOutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b) throws IOException
      Overrides:
      write in class FilterOutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Overrides:
      write in class FilterOutputStream
      Throws:
      IOException
    • writeEncoded

      protected abstract void writeEncoded(byte[] data, int offset, int length) throws IOException
      Encode the given raw bytes and write the result to the wrapped output stream.
      Parameters:
      data - Raw bytes to be encoded and written.
      offset - Starting index of data to be written in input byte array.
      length - Number of bytes to be written from input byte array.
      Throws:
      IOException - On write errors.