public class EOLConvertingInputStream extends InputStream
\r
bytes not followed by \n
and \n
not
preceded by \r
to \r\n
.Modifier and Type | Field and Description |
---|---|
static int |
CONVERT_BOTH
Converts single '\r' and '\n' to '\r\n'
|
static int |
CONVERT_CR
Converts single '\r' to '\r\n'
|
static int |
CONVERT_LF
Converts single '\n' to '\r\n'
|
Constructor and Description |
---|
EOLConvertingInputStream(InputStream in)
Creates a new
EOLConvertingInputStream
instance converting bytes in the given InputStream . |
EOLConvertingInputStream(InputStream in,
int flags)
Creates a new
EOLConvertingInputStream
instance converting bytes in the given InputStream . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying stream.
|
int |
read() |
available, mark, markSupported, read, read, reset, skip
public static final int CONVERT_CR
public static final int CONVERT_LF
public static final int CONVERT_BOTH
public EOLConvertingInputStream(InputStream in)
EOLConvertingInputStream
instance converting bytes in the given InputStream
.
The flag CONVERT_BOTH
is the default.in
- the InputStream
to read from.public EOLConvertingInputStream(InputStream in, int flags)
EOLConvertingInputStream
instance converting bytes in the given InputStream
.in
- the InputStream
to read from.flags
- one of CONVERT_CR
, CONVERT_LF
or
CONVERT_BOTH
.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
- on I/O errors.public int read() throws IOException
read
in class InputStream
IOException
InputStream.read()
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.