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
AFixedLengthWriter
is used to write records to fixed length flat file or output stream. A fixed length record is represented using theString
class.- 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 void
close()
Closes the output stream.void
flush()
Flushes the output stream.void
write(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, RecordIOException
Description copied from interface:RecordWriter
Writes a record object to this output stream.- Specified by:
write
in 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.IOException
Description copied from interface:RecordWriter
Flushes the output stream.- Specified by:
flush
in interfaceRecordWriter
- Throws:
java.io.IOException
- if an I/O error occurs flushing the stream
-
close
public void close() throws java.io.IOException
Description copied from interface:RecordWriter
Closes the output stream.- Specified by:
close
in interfaceRecordWriter
- Throws:
java.io.IOException
- if an I/O error occurs closing the stream
-
-