Class SimpleBinaryBufferedReaderFactory
- java.lang.Object
- org.springframework.batch.item.file.SimpleBinaryBufferedReaderFactory
- All Implemented Interfaces:
BufferedReaderFactory
public class SimpleBinaryBufferedReaderFactory extends java.lang.Object implements BufferedReaderFactory
ABufferedReaderFactory
useful for reading simple binary (or text) files with no line endings, such as those produced by mainframe copy books. The reader splits a stream up across fixed line endings (rather than the usual convention based on plain text). The line endings are discarded, just as with the default plain text implementation.- Since:
- 2.1
- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description SimpleBinaryBufferedReaderFactory()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.BufferedReader
create(org.springframework.core.io.Resource resource, java.lang.String encoding)
Create aBufferedReader
for reading String items from the provided resource.void
setLineEnding(java.lang.String lineEnding)
Method Detail
setLineEnding
public void setLineEnding(java.lang.String lineEnding)
- Parameters:
lineEnding
-String
indicating what defines the end of a "line".
create
public java.io.BufferedReader create(org.springframework.core.io.Resource resource, java.lang.String encoding) throws java.io.UnsupportedEncodingException, java.io.IOException
Description copied from interface:BufferedReaderFactory
Create aBufferedReader
for reading String items from the provided resource.- Specified by:
create
in interfaceBufferedReaderFactory
- Parameters:
resource
- aResource
containing the data to be readencoding
- the encoding required for converting binary data to String- Returns:
- a
BufferedReader
- Throws:
java.io.UnsupportedEncodingException
- if the encoding is not supported by the platformjava.io.IOException
- if there is a problem creating the reader