public class SharedByteArrayInputStream
extends java.io.ByteArrayInputStream
implements jakarta.mail.internet.SharedInputStream
Constructor and Description |
---|
SharedByteArrayInputStream(byte[] buf)
Creates a SharedByteArrayInputStream for reading data from
the given byte array.
|
SharedByteArrayInputStream(byte[] buf,
int offset,
int length)
Creates a SharedByteArrayInputStream for reading data from
a sub-array of the given byte array.
|
Modifier and Type | Method and Description |
---|---|
long |
getPosition()
Gets the current postion of the stream as offset
from the start postion.
|
java.io.InputStream |
newStream(long start,
long end)
Gets a new SharedInputStream as substream from this InputStream.
|
public SharedByteArrayInputStream(byte[] buf)
buf
- the data carrying byte arraypublic SharedByteArrayInputStream(byte[] buf, int offset, int length)
buf
- the data carrying byte arrayoffset
- the position in the byte array from which to start readinglength
- the maximum number of bytes that can be readpublic long getPosition()
getPosition
in interface jakarta.mail.internet.SharedInputStream
public java.io.InputStream newStream(long start, long end)
newStream
in interface jakarta.mail.internet.SharedInputStream
start
- the start position in the current streamend
- the end position (+1) in the current stream;
-1 if the new stream shall end at the same position
as this stream