public class EOLProcessor extends Object
This class processes text data and corrects line endings according to the settings provided. Specifically you can set the input style to process so that lone \r and \n characters within a \r\n encoded file are written through without amendments (the SFTP protocol states that this must be the case when processing text files).
Modifier and Type | Field and Description |
---|---|
static int |
TEXT_ALL
This input style instructs the conversion to strip
all line ending type characters and replace with the output style
line ending
|
static int |
TEXT_CR
This indicates a CR line ending style and can be used for either
input or output style parameters
|
static int |
TEXT_CRLF |
static int |
TEXT_DOS
This indicates a CRLF line ending combination and can be used
for both input and output style parameters.
|
static int |
TEXT_LF
This indicates a single LF line ending style and can be used for
either input or output style parameters
|
static int |
TEXT_MAC
This indicates a MAC line ending and can be used in either the
input or output style parameters
|
static int |
TEXT_SYSTEM
This output style specifies that the text will have line endings set to
the current system setting.
|
static int |
TEXT_UNIX
This indicates a LF line ending style and can be
used for either input or output style parameters
|
static int |
TEXT_WINDOWS
This indicates a CRLF line ending combination and can be used
for both input and output style parameters.
|
Constructor and Description |
---|
EOLProcessor(int inputStyle,
int outputStyle,
OutputStream out) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static InputStream |
createInputStream(int inputStyle,
int outputStyle,
InputStream in) |
static OutputStream |
createOutputStream(int inputStyle,
int outputStyle,
OutputStream out) |
boolean |
hasBinary()
Check to see if binary data was encountered during the encoding
process
|
void |
processBytes(byte[] buf,
int off,
int len) |
public static final int TEXT_SYSTEM
public static final int TEXT_WINDOWS
public static final int TEXT_DOS
public static final int TEXT_CRLF
public static final int TEXT_UNIX
public static final int TEXT_LF
public static final int TEXT_MAC
public static final int TEXT_CR
public static final int TEXT_ALL
public EOLProcessor(int inputStyle, int outputStyle, OutputStream out) throws IOException
IOException
public boolean hasBinary()
public void close() throws IOException
IOException
public void processBytes(byte[] buf, int off, int len) throws IOException
buf
- byte[]off
- intlen
- intout
- OutputStreamIOException
public static OutputStream createOutputStream(int inputStyle, int outputStyle, OutputStream out) throws IOException
IOException
public static InputStream createInputStream(int inputStyle, int outputStyle, InputStream in) throws IOException
IOException
Copyright © 2024. All rights reserved.