Package com.sun.mail.imap
Class LengthCounter
- java.lang.Object
-
- java.io.OutputStream
-
- com.sun.mail.imap.LengthCounter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
class LengthCounter extends java.io.OutputStream
Count the number of bytes written to the stream. Also, save a copy of small messages to avoid having to process the data again.
-
-
Constructor Summary
Constructors Constructor Description LengthCounter(int maxsize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes()
int
getSize()
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
-
-
-
Method Detail
-
write
public void write(int b)
- Specified by:
write
in classjava.io.OutputStream
-
write
public void write(byte[] b, int off, int len)
- Overrides:
write
in classjava.io.OutputStream
-
write
public void write(byte[] b) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
getSize
public int getSize()
-
getBytes
public byte[] getBytes()
-
-