step.io
Class StepTextOutput

java.lang.Object
  |
  +--step.io.StepTextOutput
All Implemented Interfaces:
StepRecordOutput

public class StepTextOutput
extends Object
implements StepRecordOutput

Write STEP objects as text, one per line.

NOTE: This writer assumes that all written objects (and their fields) have an appropriate definition for toString().

See Also:
StepRecord

Constructor Summary
StepTextOutput(PrintWriter output)
          Create a STEP text output stream which prints to the given output stream.
 
Method Summary
(package private) static String asText(StepRecord record)
           
 void close()
          Close this output stream.
 void flush()
          Flush this output stream.
 void writeRecord(StepRecord record)
          Write a STEP record to this output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StepTextOutput

public StepTextOutput(PrintWriter output)
Create a STEP text output stream which prints to the given output stream.

Method Detail

writeRecord

public void writeRecord(StepRecord record)
                 throws IOException
Description copied from interface: StepRecordOutput
Write a STEP record to this output stream.

NOTE: The writing of some records may generate meta-data that is inserted into the data stream.

Specified by:
writeRecord in interface StepRecordOutput
Throws:
IOException - never. The underlying PrintWriter does not throw on writes.

close

public void close()
           throws IOException
Description copied from interface: StepRecordOutput
Close this output stream.

Specified by:
close in interface StepRecordOutput
IOException

flush

public void flush()
           throws IOException
Description copied from interface: StepRecordOutput
Flush this output stream.

Specified by:
flush in interface StepRecordOutput
IOException

asText

static String asText(StepRecord record)