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
IOExceptionpublic CachedOutputStream()
public CachedOutputStream(long threshold)
public void holdTempFile()
public void releaseTempFileHold()
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void lockOutputStream()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic long size()
public byte[] getBytes()
throws IOException
IOExceptionpublic void writeCacheTo(StringBuilder out, String charsetName) throws IOException
IOExceptionpublic OutputStream getOut()
protected void onWrite()
throws IOException
IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic File getTempFile()
public InputStream getInputStream() throws IOException
IOExceptionpublic void setOutputDir(File outputDir) throws IOException
IOExceptionpublic 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.