Package chemaxon.formats
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 int
COMPRESS
Compression flag.static int
DECOMPRESS
Decompression.static int
SDF
static int
TEXTMODE
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
convert()
Compression/decompressionstatic 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.
-
-
-
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 thatWrite 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 streamout
- the output molecule streamflags
- compression or decompression, binary or text mode- See Also:
DECOMPRESS
,COMPRESS
-
-
Method Detail
-
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 SDfileflags
- compression or decompression, binary or text mode- Returns:
- the (un)compressed molfile or SDfile
- Throws:
MolFormatException
- if the input is in bad formatIOException
- 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 SDfileflags
- compression or decompression, binary or text mode- Returns:
- the (un)compressed molfile or SDfile
- Throws:
MolFormatException
- if the input is in bad formatIOException
- 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
.
-
-