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.OutputStreamAn 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 voidbdat(byte[] b, int off, int len, boolean last)Send the specified bytes using the BDAT command.voidclose()Close this output stream.voidflush()Flush this output stream.voidwrite(byte[] b, int off, int len)Writes len bytes to this output stream starting at off.voidwrite(int b)Writes the specifiedbyteto this output stream.
-
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOExceptionWrites the specifiedbyteto this output stream.- Specified by:
writein 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.IOExceptionWrites len bytes to this output stream starting at off.- Overrides:
writein 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.IOExceptionFlush this output stream.- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException- for I/O errors
-
close
public void close() throws java.io.IOExceptionClose this output stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein 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.IOExceptionSend the specified bytes using the BDAT command.- Throws:
java.io.IOException
-
-