Class SimpleBinaryBufferedReaderFactory
java.lang.Object
org.springframework.batch.item.file.SimpleBinaryBufferedReaderFactory
- All Implemented Interfaces:
BufferedReaderFactory
A
BufferedReaderFactory 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, Mahmoud Ben Hassine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate aBufferedReaderfor reading String items from the provided resource.voidsetLineEnding(String lineEnding)
-
Constructor Details
-
SimpleBinaryBufferedReaderFactory
public SimpleBinaryBufferedReaderFactory()
-
-
Method Details
-
setLineEnding
- Parameters:
lineEnding-Stringindicating what defines the end of a "line".
-
create
public BufferedReader create(org.springframework.core.io.Resource resource, String encoding) throws IOException Description copied from interface:BufferedReaderFactoryCreate aBufferedReaderfor reading String items from the provided resource.- Specified by:
createin interfaceBufferedReaderFactory- Parameters:
resource- aResourcecontaining the data to be readencoding- the encoding required for converting binary data to String- Returns:
- a
BufferedReader - Throws:
UnsupportedEncodingException- if the encoding is not supported by the platformIOException- if there is a problem creating the reader
-