public class CachedOutputStream extends OutputStream
Modifier and Type | Field and Description |
---|---|
protected OutputStream |
currentStream |
protected boolean |
outputLocked |
Constructor and Description |
---|
CachedOutputStream() |
CachedOutputStream(long threshold) |
CachedOutputStream(PipedInputStream stream) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
equals(Object obj) |
void |
flush() |
byte[] |
getBytes() |
InputStream |
getInputStream() |
OutputStream |
getOut() |
File |
getTempFile() |
int |
hashCode() |
void |
holdTempFile() |
void |
lockOutputStream()
Locks the output stream to prevent additional writes, but maintains
a pointer to it so an InputStream can be obtained
|
protected void |
onWrite() |
void |
releaseTempFileHold() |
static void |
setDefaultMaxSize(long l) |
static void |
setDefaultThreshold(int i) |
void |
setMaxSize(long maxSize) |
void |
setOutputDir(File outputDir) |
void |
setThreshold(long threshold) |
long |
size() |
String |
toString() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeCacheTo(StringBuilder out,
String charsetName) |
protected boolean outputLocked
protected OutputStream currentStream
public CachedOutputStream(PipedInputStream stream) throws IOException
IOException
public CachedOutputStream()
public CachedOutputStream(long threshold)
public void holdTempFile()
public void releaseTempFileHold()
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void lockOutputStream() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public long size()
public byte[] getBytes() throws IOException
IOException
public void writeCacheTo(StringBuilder out, String charsetName) throws IOException
IOException
public OutputStream getOut()
protected void onWrite() throws IOException
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public File getTempFile()
public InputStream getInputStream() throws IOException
IOException
public void setOutputDir(File outputDir) throws IOException
IOException
public void setThreshold(long threshold)
public void setMaxSize(long maxSize)
public static void setDefaultMaxSize(long l)
public static void setDefaultThreshold(int i)
Copyright © 2013 JBoss, by Red Hat. All Rights Reserved.