Class MdlCompressor

    • Field Detail

      • DECOMPRESS

        public static int DECOMPRESS
        Decompression. Default, its value is zero.
        Since:
        Marvin 4.0.3, 11/06/2005
      • COMPRESS

        public static int COMPRESS
        Compression flag.
      • SDF

        public static int SDF
      • TEXTMODE

        @Deprecated
        public static int TEXTMODE
        Deprecated.
        as of Marvin 3.1, there is no possibility to do that
        Write OS dependent line.separators instead of '\n'.
    • Constructor Detail

      • MdlCompressor

        public MdlCompressor​(InputStream in,
                             OutputStream out,
                             int flags)
        Create a(n un)compressor for the specified input and output streams.
        Parameters:
        in - the input molecule stream
        out - the output molecule stream
        flags - compression or decompression, binary or text mode
        See Also:
        DECOMPRESS, COMPRESS
    • Method Detail

      • convert

        public static byte[] convert​(byte[] mol,
                                     int flags)
                              throws IOException
        (Un)compress the specified molfile or SDfile.
        Parameters:
        mol - the input molfile or SDfile
        flags - compression or decompression, binary or text mode
        Returns:
        the (un)compressed molfile or SDfile
        Throws:
        MolFormatException - if the input is in bad format
        IOException - if the input file is ended unexpectedly
        See Also:
        DECOMPRESS, COMPRESS
      • convert

        public static String convert​(String mol,
                                     int flags)
                              throws IOException
        (Un)compress the specified molfile or SDfile.
        Parameters:
        mol - the input molfile or SDfile
        flags - compression or decompression, binary or text mode
        Returns:
        the (un)compressed molfile or SDfile
        Throws:
        MolFormatException - if the input is in bad format
        IOException - if the input file is ended unexpectedly
        See Also:
        DECOMPRESS, COMPRESS
      • main

        public static void main​(String[] args)
        Main program. Usage: java chemaxon.formats.MdlCompressor command molfile. Compression: command=c, decompression: command=d.