chemaxon.formats
Class MolInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byjava.io.BufferedInputStream
              extended bychemaxon.marvin.io.PositionedInputStream
                  extended bychemaxon.formats.MolInputStream

public class MolInputStream
extends chemaxon.marvin.io.PositionedInputStream

Molecule input stream that has the ability to determine the input file format.

Version:
4.1, 06/29/2006
Author:
Peter Csizmadia, Szilard Dorant

Field Summary
 
Fields inherited from class chemaxon.marvin.io.PositionedInputStream
lineBuf, lineCurrentColumn
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MolInputStream(java.io.InputStream is)
          Create a molecule input stream from an ordinary one, and determine the format.
MolInputStream(java.io.InputStream is, java.lang.String fmt)
          Create a molecule input stream from an ordinary one, If null is specified as the fmt argument, then the file format is determined automatically.
MolInputStream(java.io.InputStream is, java.lang.String fmt, java.lang.String enc)
          Create a molecule input stream from an ordinary one, If null is specified as the fmt argument, then the file format is determined automatically.
MolInputStream(java.io.InputStream is, java.lang.String fmt, java.lang.String enc, java.lang.String fname)
          Create a molecule input stream from an ordinary one, If null is specified as the fmt argument, then the file format is determined automatically.
 
Method Summary
static boolean canBeAbbrevgroup(java.lang.String line)
          Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeAbbrevgroup(String) must be used instead
static boolean canBeBase64(java.lang.String line)
          Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeBase64(String) must be used instead
static boolean canBeChime(java.lang.String s)
          Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeChime(String) must be used instead
static boolean canBeJTF(java.lang.String line)
          Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeJTF(String) must be used instead
static boolean canBeSMARTS(java.lang.String s)
          Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeSMARTS(String) must be used instead
static boolean canBeSMILES(java.lang.String s)
          Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeSMILES(String) must be used instead
 java.lang.String getFormat()
          Get the molecule file format.
static java.util.Vector getJtfFields(java.lang.String line)
          Deprecated. as of Marvin 4.1, MFileFormatUtil.getJTFFields(String) must be used instead
 
Methods inherited from class chemaxon.marvin.io.PositionedInputStream
bufincRead, endGrabLines, getEncoding, getFilePointer, getGrabbedLines, getLineCount, isSeekable, length, putBackLine, read, read, readLine, reset, resetFilePointer, seek, setDesiredBufferSize, setEncoding, skip, startGrabLines
 
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MolInputStream

public MolInputStream(java.io.InputStream is)
               throws java.io.IOException
Create a molecule input stream from an ordinary one, and determine the format.

Parameters:
is - the original input stream
Throws:
java.io.IOException - error occured while trying to guess the file format

MolInputStream

public MolInputStream(java.io.InputStream is,
                      java.lang.String fmt)
               throws java.io.IOException
Create a molecule input stream from an ordinary one, If null is specified as the fmt argument, then the file format is determined automatically. If "mol" or "csmol" is specified, then the file format is determined from the first line as "mol", "csmol", "rxn", "csrxn", "rgf" or "csrgf".

Parameters:
is - the original input stream
fmt - the input file format or null
Throws:
java.io.IOException - error occured while trying to guess the file format

MolInputStream

public MolInputStream(java.io.InputStream is,
                      java.lang.String fmt,
                      java.lang.String enc)
               throws java.io.IOException
Create a molecule input stream from an ordinary one, If null is specified as the fmt argument, then the file format is determined automatically. If "mol" or "csmol" is specified, then the file format is determined from the first line as "mol", "csmol", "rxn", "csrxn", "rgf" or "csrgf".

Parameters:
is - the original input stream
fmt - the input file format or null
enc - the input encoding or null
Throws:
java.io.IOException - error occured while trying to guess the file format
Since:
Marvin 3.5.5

MolInputStream

public MolInputStream(java.io.InputStream is,
                      java.lang.String fmt,
                      java.lang.String enc,
                      java.lang.String fname)
               throws java.io.IOException
Create a molecule input stream from an ordinary one, If null is specified as the fmt argument, then the file format is determined automatically. If "mol" or "csmol" is specified, then the file format is determined from the first line as "mol", "csmol", "rxn", "csrxn", "rgf" or "csrgf". If the file format cannot be determined from the contents and the file name is not null, then the file extension is used to guess the format.

Parameters:
is - the original input stream
fmt - the input file format or null
enc - the input encoding or null
fname - the file name (it can also be a path or URL) or null
Throws:
java.io.IOException - error occured while trying to guess the file format
Since:
Marvin 4.1, 01/03/2006
Method Detail

getFormat

public java.lang.String getFormat()
Get the molecule file format.

Returns:
the format

canBeBase64

public static boolean canBeBase64(java.lang.String line)
Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeBase64(String) must be used instead


canBeChime

public static boolean canBeChime(java.lang.String s)
Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeChime(String) must be used instead


canBeSMARTS

public static boolean canBeSMARTS(java.lang.String s)
Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeSMARTS(String) must be used instead


canBeSMILES

public static boolean canBeSMILES(java.lang.String s)
Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeSMILES(String) must be used instead


canBeAbbrevgroup

public static boolean canBeAbbrevgroup(java.lang.String line)
Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeAbbrevgroup(String) must be used instead


canBeJTF

public static boolean canBeJTF(java.lang.String line)
Deprecated. as of Marvin 4.1, MFileFormatUtil.canBeJTF(String) must be used instead

Since:
Marvin 2.9.9

getJtfFields

public static java.util.Vector getJtfFields(java.lang.String line)
Deprecated. as of Marvin 4.1, MFileFormatUtil.getJTFFields(String) must be used instead

Since:
Marvin 2.9.9