com.dxfeed.ipf
Class InstrumentProfileReader

java.lang.Object
  extended by com.dxfeed.ipf.InstrumentProfileReader
Direct Known Subclasses:
CMEParser, OCCParser

public class InstrumentProfileReader
extends java.lang.Object

Reads instrument profiles from the stream using Simple File Format. Please see Instrument Profile Format documentation for complete description.

This reader automatically uses data formats as specified in the stream.


Nested Class Summary
protected static class InstrumentProfileReader.UncloseableInputStream
          Delegating InputStream that does not close underlying stream.
 
Constructor Summary
InstrumentProfileReader()
           
 
Method Summary
 java.util.List<InstrumentProfile> read(java.io.InputStream in)
          Reads and returns instrument profiles from specified stream.
 java.util.List<InstrumentProfile> read(java.io.InputStream in, java.lang.String name)
          Reads and returns instrument profiles from specified stream using specified name to select data compression format.
 java.util.List<InstrumentProfile> readFromFile(java.lang.String source)
          Reads and returns instrument profiles from specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentProfileReader

public InstrumentProfileReader()
Method Detail

readFromFile

public java.util.List<InstrumentProfile> readFromFile(java.lang.String source)
                                               throws java.io.IOException
Reads and returns instrument profiles from specified file. This method recognizes popular data compression formats "zip" and "gzip" by analysing file name. If file name ends with ".zip" then all compressed files will be read independently one by one in their order of appearing and total concatenated list of instrument profiles will be returned. If file name ends with ".gz" then compressed content will be read and returned. In other cases file will be considered uncompressed and will be read as is.

Parameters:
source - URL of file to read from
Returns:
list of instrument profiles
Throws:
InstrumentProfileFormatException - if input stream does not conform to the Simple File Format
java.io.IOException - If an I/O error occurs

read

public java.util.List<InstrumentProfile> read(java.io.InputStream in,
                                              java.lang.String name)
                                       throws java.io.IOException
Reads and returns instrument profiles from specified stream using specified name to select data compression format. This method recognizes popular data compression formats "zip" and "gzip" by analysing file name. If file name ends with ".zip" then all compressed files will be read independently one by one in their order of appearing and total concatenated list of instrument profiles will be returned. If file name ends with ".gz" then compressed content will be read and returned. In other cases file will be considered uncompressed and will be read as is.

Throws:
InstrumentProfileFormatException - if input stream does not conform to the Simple File Format
java.io.IOException - If an I/O error occurs

read

public java.util.List<InstrumentProfile> read(java.io.InputStream in)
                                       throws java.io.IOException
Reads and returns instrument profiles from specified stream.

Throws:
InstrumentProfileFormatException - if input stream does not conform to the Simple File Format
java.io.IOException - If an I/O error occurs