Package com.sun.mail.smtp
Class SMTPTransport.ChunkedOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.sun.mail.smtp.SMTPTransport.ChunkedOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
- Enclosing class:
- SMTPTransport
private class SMTPTransport.ChunkedOutputStream extends java.io.OutputStream
An OutputStream that buffers data in chunks and uses the RFC 3030 BDAT SMTP command to send each chunk.
-
-
Constructor Summary
Constructors Constructor Description ChunkedOutputStream(java.io.OutputStream out, int size)
Create a ChunkedOutputStream built on top of the specified underlying output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 specifiedbyte
to this output stream.
-
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException
Writes the specifiedbyte
to this output stream.- Specified by:
write
in classjava.io.OutputStream
- Parameters:
b
- the byte to write- Throws:
java.io.IOException
- for I/O errors
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
Writes len bytes to this output stream starting at off.- Overrides:
write
in classjava.io.OutputStream
- Parameters:
b
- bytes to writeoff
- offset in arraylen
- number of bytes to write- Throws:
java.io.IOException
- for I/O errors
-
flush
public void flush() throws java.io.IOException
Flush this output stream.- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
- for I/O errors
-
close
public void close() throws java.io.IOException
Close this output stream.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
- for I/O errors
-
bdat
private void bdat(byte[] b, int off, int len, boolean last) throws java.io.IOException
Send the specified bytes using the BDAT command.- Throws:
java.io.IOException
-
-