BeanIO 1.2.3

org.beanio.stream.fixedlength
Class FixedLengthWriter

java.lang.Object
  extended by org.beanio.stream.fixedlength.FixedLengthWriter
All Implemented Interfaces:
RecordWriter

public class FixedLengthWriter
extends Object
implements RecordWriter

A FixedLengthWriter is used to write records to fixed length flat file or output stream. A fixed length record is represented using the String class.

Since:
1.0
Author:
Kevin Seim

Constructor Summary
FixedLengthWriter(Writer out)
          Constructs a new FixedLegthWriter.
FixedLengthWriter(Writer out, String recordTerminator)
          Constructs a new FixedLegthWriter.
 
Method Summary
 void close()
          Closes the output stream.
 void flush()
          Flushes the output stream.
 void write(Object value)
          Writes a record object to this output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedLengthWriter

public FixedLengthWriter(Writer out)
Constructs a new FixedLegthWriter.

Parameters:
out - the output stream to write to

FixedLengthWriter

public FixedLengthWriter(Writer out,
                         String recordTerminator)
Constructs a new FixedLegthWriter.

Parameters:
out - the output stream to write to
recordTerminator - the text used to terminate a record
Method Detail

write

public void write(Object value)
           throws IOException,
                  RecordIOException
Description copied from interface: RecordWriter
Writes a record object to this output stream.

Specified by:
write in interface RecordWriter
Parameters:
value - the record object to write
Throws:
IOException - if an I/O error occurs writing the record to the stream
RecordIOException

flush

public void flush()
           throws IOException
Description copied from interface: RecordWriter
Flushes the output stream.

Specified by:
flush in interface RecordWriter
Throws:
IOException - if an I/O error occurs flushing the stream

close

public void close()
           throws IOException
Description copied from interface: RecordWriter
Closes the output stream.

Specified by:
close in interface RecordWriter
Throws:
IOException - if an I/O error occurs closing the stream

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim