public abstract class LineTransformationOutputStream extends OutputStream
OutputStream
that buffers text by line, so that the derived class
can perform some manipulation based on the contents of the whole line.
Subclass LineTransformationOutputStream.Delegating
in the typical case that you are decorating an underlying stream.
Modifier and Type | Class and Description |
---|---|
static class |
LineTransformationOutputStream.Delegating
Convenience subclass for cases where you wish to process lines being sent to an underlying stream.
|
Constructor and Description |
---|
LineTransformationOutputStream() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract void |
eol(byte[] b,
int len)
Called for each end of the line.
|
void |
forceEol()
Forces the EOL behavior.
|
protected String |
trimEOL(String line) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
flush, write
protected abstract void eol(byte[] b, int len) throws IOException
b
- Contents of the whole line, including the EOL code like CR/LF.len
- Specifies the length of the valid contents in 'b'. The rest is garbage.
This is so that the caller doesn't have to allocate an array of the exact size.IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void forceEol() throws IOException
IOException
Copyright © 2004–2021. All rights reserved.