Package ome.codecs

Class Base64Codec

  • All Implemented Interfaces:
    Codec

    public class Base64Codec
    extends BaseCodec
    Implements encoding (compress) and decoding (decompress) methods for Base64. This code was adapted from the Jakarta Commons Codec source, http://jakarta.apache.org/commons
    Author:
    Melissa Linkert melissa at glencoesoftware.com
    • Constructor Detail

      • Base64Codec

        public Base64Codec()
    • Method Detail

      • compress

        public byte[] compress​(byte[] input,
                               CodecOptions options)
                        throws CodecException
        Description copied from interface: Codec
        Compresses a block of data.
        Parameters:
        input - The data to be compressed.
        options - Options to be used during compression, if appropriate.
        Returns:
        The compressed data.
        Throws:
        CodecException - If input is not a compressed data block of the appropriate type.
      • decompress

        public byte[] decompress​(loci.common.RandomAccessInputStream in,
                                 CodecOptions options)
                          throws CodecException,
                                 IOException
        Description copied from interface: Codec
        Decompresses data from the given RandomAccessInputStream.
        Specified by:
        decompress in interface Codec
        Specified by:
        decompress in class BaseCodec
        Parameters:
        in - The stream from which to read compressed data.
        options - Options to be used during decompression.
        Returns:
        The decompressed data.
        Throws:
        CodecException - If data is not valid compressed data for this decompressor.
        IOException