public class SimpleBinaryBufferedReaderFactory extends java.lang.Object implements BufferedReaderFactory
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.Constructor and Description |
---|
SimpleBinaryBufferedReaderFactory() |
Modifier and Type | Method and Description |
---|---|
java.io.BufferedReader |
create(org.springframework.core.io.Resource resource,
java.lang.String encoding)
Create a
BufferedReader for reading String items from the
provided resource. |
void |
setLineEnding(java.lang.String lineEnding) |
public void setLineEnding(java.lang.String lineEnding)
lineEnding
- String
indicating what defines the end of a "line".public java.io.BufferedReader create(org.springframework.core.io.Resource resource, java.lang.String encoding) throws java.io.UnsupportedEncodingException, java.io.IOException
BufferedReaderFactory
BufferedReader
for reading String items from the
provided resource.create
in interface BufferedReaderFactory
resource
- a Resource
containing the data to be readencoding
- the encoding required for converting binary data to
StringBufferedReader
java.io.UnsupportedEncodingException
- if the encoding is not supported by
the platformjava.io.IOException
- if there is a problem creating the reader