Interface Encoder

  • All Known Implementing Classes:
    Base64Encoder, PackBitsEncoder

    public interface Encoder
    Interface for encoders. An Encoder may be used with an EncoderStream, to perform on-the-fly encoding to an OutputStream.

    Important note: Encoder implementations are typically not synchronized.

    Version:
    $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/Encoder.java#2 $
    Author:
    Harald Kuhr
    See Also:
    Decoder, EncoderStream
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void encode​(java.io.OutputStream stream, java.nio.ByteBuffer buffer)
      Encodes up to buffer.remaining() bytes into the given input stream, from the given buffer.
    • Method Detail

      • encode

        void encode​(java.io.OutputStream stream,
                    java.nio.ByteBuffer buffer)
             throws java.io.IOException
        Encodes up to buffer.remaining() bytes into the given input stream, from the given buffer.
        Parameters:
        stream - the output stream to encode data to
        buffer - buffer to read data from
        Throws:
        java.io.IOException - if an I/O error occurs