Package chemaxon.formats
Class MolInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
chemaxon.marvin.io.PositionedInputStream
chemaxon.formats.MolInputStream
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Molecule input stream that has the ability to determine the input file
 format.
- 
Field SummaryFields inherited from class chemaxon.marvin.io.PositionedInputStreamencoding, keeporiginalLineEnding, lineByteBuffer, lineCurrentColumnFields inherited from class java.io.FilterInputStreamin
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a molecule input stream from an ordinary one, and determine the format.MolInputStream(InputStream is, 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(InputStream is, String fmt, 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(InputStream is, String fmt, String enc, String path) 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 SummaryMethods inherited from class chemaxon.marvin.io.PositionedInputStreambufincRead, clearMark, endGrabLines, getEncoding, getFilePointer, getGrabbedLines, getLastEOL, getLineCount, getWord, isSeekable, length, putBackLine, putBackLine, read, read, readLine, reset, resetFilePointer, seek, setByteOrder, setDesiredBufferSize, setEncoding, setEncoding, setWord, skip, skipLine, startGrabLinesMethods inherited from class java.io.BufferedInputStreamavailable, close, mark, markSupported, transferToMethods inherited from class java.io.FilterInputStreamreadMethods inherited from class java.io.InputStreamnullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes
- 
Constructor Details- 
MolInputStreamCreate a molecule input stream from an ordinary one, and determine the format.- Parameters:
- is- the original input stream
- Throws:
- IOException- error occurred while trying to guess the file format
 
- 
MolInputStreamCreate 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:
- IOException- error occurred while trying to guess the file format
 
- 
MolInputStreamCreate 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:
- IOException- error occurred while trying to guess the file format
- Since:
- Marvin 3.5.5
 
- 
MolInputStreamCreate 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
- path- the file path (it can also be an URL) or- null
- Throws:
- IOException- error occurred while trying to guess the file format
- Since:
- Marvin 4.1, 01/03/2006
 
 
- 
- 
Method Details- 
getFormatGet the molecule file format.- Returns:
- "mrv", "mol", "mol:V3", "csmol", "sdf", "cssdf", "rdf", "csrdf", "smiles", "sybyl", "mol2", "pdb", "xyz" or "cube" or "inchi", "gzip" or "chemaxon.struc.Molecule" if imported from ObjectInputStream (serialized molecule)
 
- 
setFormatSets the molecule file format.- Parameters:
- fmt- the format
- Since:
- Marvin 5.0, 05/25/2007
 
- 
getPathGets the path or URL of the file.- Returns:
- the path or nullif unknown
- Since:
- Marvin 5.3, 09/17/2009
 
 
-