Package org.beanio.stream.fixedlength
Class FixedLengthWriter
- java.lang.Object
-
- org.beanio.stream.fixedlength.FixedLengthWriter
-
- All Implemented Interfaces:
RecordWriter
public class FixedLengthWriter extends java.lang.Object implements RecordWriter
AFixedLengthWriteris used to write records to fixed length flat file or output stream. A fixed length record is represented using theStringclass.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description FixedLengthWriter(java.io.Writer out)Constructs a newFixedLegthWriter.FixedLengthWriter(java.io.Writer out, java.lang.String recordTerminator)Constructs a newFixedLegthWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the output stream.voidflush()Flushes the output stream.voidwrite(java.lang.Object value)Writes a record object to this output stream.
-
-
-
Constructor Detail
-
FixedLengthWriter
public FixedLengthWriter(java.io.Writer out)
Constructs a newFixedLegthWriter.- Parameters:
out- the output stream to write to
-
FixedLengthWriter
public FixedLengthWriter(java.io.Writer out, java.lang.String recordTerminator)Constructs a newFixedLegthWriter.- Parameters:
out- the output stream to write torecordTerminator- the text used to terminate a record
-
-
Method Detail
-
write
public void write(java.lang.Object value) throws java.io.IOException, RecordIOExceptionDescription copied from interface:RecordWriterWrites a record object to this output stream.- Specified by:
writein interfaceRecordWriter- Parameters:
value- the record object to write- Throws:
java.io.IOException- if an I/O error occurs writing the record to the streamRecordIOException
-
flush
public void flush() throws java.io.IOExceptionDescription copied from interface:RecordWriterFlushes the output stream.- Specified by:
flushin interfaceRecordWriter- Throws:
java.io.IOException- if an I/O error occurs flushing the stream
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:RecordWriterCloses the output stream.- Specified by:
closein interfaceRecordWriter- Throws:
java.io.IOException- if an I/O error occurs closing the stream
-
-