private class SMTPTransport.ChunkedOutputStream
extends java.io.OutputStream
Modifier and Type | Field and Description |
---|---|
private byte[] |
buf |
private int |
count |
private java.io.OutputStream |
out |
Constructor and Description |
---|
ChunkedOutputStream(java.io.OutputStream out,
int size)
Create a ChunkedOutputStream built on top of the specified
underlying output stream.
|
Modifier and Type | Method and Description |
---|---|
private void |
bdat(byte[] b,
int off,
int len,
boolean last)
Send the specified bytes using the BDAT command.
|
void |
close()
Close this output stream.
|
void |
flush()
Flush this output stream.
|
void |
write(byte[] b,
int off,
int len)
Writes len bytes to this output stream starting at off.
|
void |
write(int b)
Writes the specified
byte to this output stream. |
private final java.io.OutputStream out
private final byte[] buf
private int count
public ChunkedOutputStream(java.io.OutputStream out, int size)
out
- the underlying output streamsize
- the chunk sizepublic void write(int b) throws java.io.IOException
byte
to this output stream.write
in class java.io.OutputStream
b
- the byte to writejava.io.IOException
- for I/O errorspublic void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
b
- bytes to writeoff
- offset in arraylen
- number of bytes to writejava.io.IOException
- for I/O errorspublic void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- for I/O errorspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
- for I/O errorsprivate void bdat(byte[] b, int off, int len, boolean last) throws java.io.IOException
java.io.IOException