chemaxon.formats
Class MdlCompressor

java.lang.Object
  extended bychemaxon.formats.MdlCompressor

public class MdlCompressor
extends java.lang.Object

Molfile compression.

Version:
3.1 04/08/2002
Author:
Peter Csizmadia

Field Summary
static int COMPRESS
          This flag must be specified for compression.
static int SDF
           
static int TEXTMODE
          Deprecated. as of Marvin 3.1, there is no possibility to do that
 
Constructor Summary
MdlCompressor(java.io.InputStream in, java.io.OutputStream out, int flags)
          Create a(n un)compressor for the specified input and output streams.
 
Method Summary
 boolean convert()
          Compression/decompression
static byte[] convert(byte[] mol, int flags)
          (Un)compress the specified molfile or SDfile.
static java.lang.String convert(java.lang.String mol, int flags)
          (Un)compress the specified molfile or SDfile.
static void main(java.lang.String[] args)
          Main program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPRESS

public static int COMPRESS
This flag must be specified for compression.


SDF

public static int SDF

TEXTMODE

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(java.io.InputStream in,
                     java.io.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:
COMPRESS
Method Detail

convert

public boolean convert()
                throws java.io.IOException
Compression/decompression

Throws:
java.io.IOException

convert

public static byte[] convert(byte[] mol,
                             int flags)
                      throws java.io.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:
chemaxon.formats.MolFormatException - if the input is in bad format
java.io.IOException - if the input file is ended unexpectedly
See Also:
COMPRESS

convert

public static java.lang.String convert(java.lang.String mol,
                                       int flags)
                                throws java.io.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:
chemaxon.formats.MolFormatException - if the input is in bad format
java.io.IOException - if the input file is ended unexpectedly
See Also:
COMPRESS

main

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