Class MdlCompressor

java.lang.Object
chemaxon.formats.MdlCompressor

@PublicAPI public class MdlCompressor extends Object
Molfile compression.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Compression flag.
    static final int
    Decompression.
    static int
     
    static final int
    Deprecated.
    as of Marvin 3.1, there is no possibility to do that
  • Constructor Summary

    Constructors
    Constructor
    Description
    MdlCompressor(InputStream in, OutputStream out, int flags)
    Create a(n un)compressor for the specified input and output streams.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compression/decompression
    static byte[]
    convert(byte[] mol, int flags)
    (Un)compress the specified molfile or SDfile.
    static String
    convert(String mol, int flags)
    (Un)compress the specified molfile or SDfile.
    static void
    main(String[] args)
    Main program.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DECOMPRESS

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

      public static final int COMPRESS
      Compression flag.
      See Also:
    • SDF

      public static int SDF
    • TEXTMODE

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

    • 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:
  • Method Details

    • convert

      public boolean convert() throws IOException
      Compression/decompression
      Throws:
      IOException
    • 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:
    • 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:
    • main

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