com.dxfeed.ipf
Class InstrumentProfileWriter

java.lang.Object
  extended by com.dxfeed.ipf.InstrumentProfileWriter

public class InstrumentProfileWriter
extends java.lang.Object

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

This writer automatically derives data formats needed to write all meaningful fields.


Nested Class Summary
protected static class InstrumentProfileWriter.UncloseableOutputStream
          Delegating OutputStream that does not close underlying stream.
 
Constructor Summary
InstrumentProfileWriter()
           
 
Method Summary
 void write(java.io.OutputStream out, java.util.List<InstrumentProfile> profiles)
          Writes specified instrument profiles into specified stream.
 void write(java.io.OutputStream out, java.lang.String name, java.util.List<InstrumentProfile> profiles)
          Writes specified instrument profiles into specified stream using specified name to select data compression format.
 void writeToFile(java.lang.String file, java.util.List<InstrumentProfile> profiles)
          Writes specified instrument profiles into specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentProfileWriter

public InstrumentProfileWriter()
Method Detail

writeToFile

public void writeToFile(java.lang.String file,
                        java.util.List<InstrumentProfile> profiles)
                 throws java.io.IOException
Writes specified instrument profiles into specified file. This method recognizes popular data compression formats "zip" and "gzip" by analysing file name. If file name ends with ".zip" then profiles will be written as a single compressed entry in a "zip" format. If file name ends with ".gz" then profiles will be compressed and written using "gzip" format. In other cases file will be considered uncompressed and profiles will be written as is.

Throws:
java.io.IOException - If an I/O error occurs

write

public void write(java.io.OutputStream out,
                  java.lang.String name,
                  java.util.List<InstrumentProfile> profiles)
           throws java.io.IOException
Writes specified instrument profiles into 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 profiles will be written as a single compressed entry in a "zip" format. If file name ends with ".gz" then profiles will be compressed and written using "gzip" format. In other cases file will be considered uncompressed and profiles will be written as is.

Throws:
java.io.IOException - If an I/O error occurs

write

public void write(java.io.OutputStream out,
                  java.util.List<InstrumentProfile> profiles)
           throws java.io.IOException
Writes specified instrument profiles into specified stream.

Throws:
java.io.IOException - If an I/O error occurs