Class TrimmerOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.apache.xml.security.stax.impl.util.TrimmerOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class TrimmerOutputStream extends java.io.FilterOutputStream
Trimms the start and the end of a stream
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
buffer
private int
bufferedCount
private int
endTrimLength
private int
preTrimmed
private int
startTrimLength
-
Constructor Summary
Constructors Constructor Description TrimmerOutputStream(java.io.OutputStream out, int bufferSize, int startTrimLength, int endTrimLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
private void
flushBuffer()
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
-
-
-
Method Detail
-
flushBuffer
private void flushBuffer() throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
-