Package org.jvnet.mimepull
Class ChunkInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.jvnet.mimepull.ChunkInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
final class ChunkInputStream extends java.io.InputStream
Constructs a InputStream from a linked list ofChunk
s.
-
-
Constructor Summary
Constructors Constructor Description ChunkInputStream(MIMEMessage msg, MIMEPart part, Chunk startPos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private boolean
fetch()
Gets to the next chunk if we are done with the current one.int
read()
int
read(byte[] b, int off, int sz)
-
-
-
Field Detail
-
current
Chunk current
-
offset
int offset
-
len
int len
-
msg
final MIMEMessage msg
-
part
final MIMEPart part
-
buf
byte[] buf
-
-
Constructor Detail
-
ChunkInputStream
public ChunkInputStream(MIMEMessage msg, MIMEPart part, Chunk startPos)
-
-
Method Detail
-
read
public int read(byte[] b, int off, int sz) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
fetch
private boolean fetch()
Gets to the next chunk if we are done with the current one.- Returns:
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-