org.springframework.batch.item.file
Class SimpleBinaryBufferedReaderFactory

java.lang.Object
  extended by org.springframework.batch.item.file.SimpleBinaryBufferedReaderFactory
All Implemented Interfaces:
BufferedReaderFactory

public class SimpleBinaryBufferedReaderFactory
extends Object
implements 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

Constructor Summary
SimpleBinaryBufferedReaderFactory()
           
 
Method Summary
 BufferedReader create(Resource resource, String encoding)
          Create a BufferedReader for reading String items from the provided resource.
 void setLineEnding(String lineEnding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBinaryBufferedReaderFactory

public SimpleBinaryBufferedReaderFactory()
Method Detail

setLineEnding

public void setLineEnding(String lineEnding)
Parameters:
lineEnding -

create

public BufferedReader create(Resource resource,
                             String encoding)
                      throws UnsupportedEncodingException,
                             IOException
Description copied from interface: BufferedReaderFactory
Create a BufferedReader for reading String items from the provided resource.

Specified by:
create in interface BufferedReaderFactory
Parameters:
resource - a Resource containing the data to be read
encoding - the encoding required for converting binary data to String
Returns:
a BufferedReader
Throws:
UnsupportedEncodingException - if the encoding is not supported by the platform
IOException - if there is a problem creating the reader


Copyright © 2013 SpringSource. All Rights Reserved.