org.das2.dataset
Class DataSetStreamProducer

java.lang.Object
  extended by org.das2.dataset.DataSetStreamProducer

public class DataSetStreamProducer
extends java.lang.Object

Configurable class for serializing a DataSet into a das2Stream. This class handles both VectorDataSets and TableDataSets, and uses java beans properties to control how the stream is produced. This code subsumes the functionality of TableUtil.dumpToDas2Stream and VectorUtil.dumpToDas2Stream.


Constructor Summary
DataSetStreamProducer()
          Creates a new instance of DataSetStreamProducer
 
Method Summary
 DataSet getDataSet()
          Getter for property dataSet.
 boolean isAsciiTransferTypes()
          Getter for property asciiTransferTypes.
 boolean isCompressed()
          Getter for property compressed.
 void setAsciiTransferTypes(boolean asciiTransferTypes)
          If true, use ascii-type transfer types when creating the stream, so the stream is more easily read by humans and stream-naive parsers.
 void setCompressed(boolean compressed)
          If true, create a compressed stream.
 void setDataSet(DataSet dataSet)
          Setter for property dataSet.
 void writeStream(java.io.OutputStream out)
          convenient method for writing to an OutputStream.
 void writeStream(java.nio.channels.WritableByteChannel out)
          writes the stream to the Channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSetStreamProducer

public DataSetStreamProducer()
Creates a new instance of DataSetStreamProducer

Method Detail

writeStream

public void writeStream(java.io.OutputStream out)
convenient method for writing to an OutputStream. Simply uses Channels.newChannel to create a WritableByteChannel.


writeStream

public void writeStream(java.nio.channels.WritableByteChannel out)
writes the stream to the Channel.


isAsciiTransferTypes

public boolean isAsciiTransferTypes()
Getter for property asciiTransferTypes.

Returns:
Value of property asciiTransferTypes.

setAsciiTransferTypes

public void setAsciiTransferTypes(boolean asciiTransferTypes)
If true, use ascii-type transfer types when creating the stream, so the stream is more easily read by humans and stream-naive parsers.

Parameters:
asciiTransferTypes - New value of property asciiTransferTypes.

isCompressed

public boolean isCompressed()
Getter for property compressed.

Returns:
Value of property compressed.

setCompressed

public void setCompressed(boolean compressed)
If true, create a compressed stream.

Parameters:
compressed - New value of property compressed.

getDataSet

public DataSet getDataSet()
Getter for property dataSet.

Returns:
Value of property dataSet.

setDataSet

public void setDataSet(DataSet dataSet)
Setter for property dataSet.

Parameters:
dataSet - New value of property dataSet.