public class SMProxyOutputStream
extends java.io.FilterOutputStream
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_BUF_SIZE
The maximum buffer size
|
| Constructor and Description |
|---|
SMProxyOutputStream(java.io.OutputStream out,
SMProxyWrapper wrapper)
The constructor takes the source outputstream, along with the
source, target and SMProxyType
|
SMProxyOutputStream(java.io.OutputStream out,
SMProxyWrapper wrapper,
int bufsize)
The constructor takes the source outputstream, along with the
source, target and SMProxyType
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Wrap any remaining bytes in the buffer using the
SMProxyWrapper and write them out.
|
java.lang.String |
getHeader(int contentLength)
Create the required HTTP header for the proxy server.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b)
Writes the specified
byte to this output stream. |
public SMProxyOutputStream(java.io.OutputStream out,
SMProxyWrapper wrapper,
int bufsize)
out - The outputstream to wrap the proxy datawrapper - The SMProxyWrapper to use to wrap the streambufsize - The buffer size in which data will be wrapped
with the required proxy information.public SMProxyOutputStream(java.io.OutputStream out,
SMProxyWrapper wrapper)
out - wrapper - public void write(int b)
throws java.io.IOException
byte to this output stream.
When the buffer if full, the data is wrapped using the SMProxyWrapper and written out.
write in class java.io.FilterOutputStreamb - the byte.java.io.IOException - if an I/O error occurs.public java.lang.String getHeader(int contentLength)
contentLength - public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterOutputStreamjava.io.IOException