iaik.smime
Class SharedByteArrayInputStream
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
iaik.smime.SharedByteArrayInputStream
- All Implemented Interfaces:
- java.io.Closeable, javax.mail.internet.SharedInputStream
public class SharedByteArrayInputStream
- extends java.io.ByteArrayInputStream
- implements javax.mail.internet.SharedInputStream
SharedInputStream implementation based on a ByteArrayInputStream.
Fields inherited from class java.io.ByteArrayInputStream |
buf, count, mark, pos |
Constructor Summary |
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. |
Method Summary |
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. |
Methods inherited from class java.io.ByteArrayInputStream |
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.io.InputStream |
read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SharedByteArrayInputStream
public SharedByteArrayInputStream(byte[] buf)
- Creates a SharedByteArrayInputStream for reading data from
the given byte array.
- Parameters:
buf
- the data carrying byte array
SharedByteArrayInputStream
public SharedByteArrayInputStream(byte[] buf,
int offset,
int length)
- Creates a SharedByteArrayInputStream for reading data from
a sub-array of the given byte array.
- Parameters:
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 read
getPosition
public long getPosition()
- Gets the current postion of the stream as offset
from the start postion.
- Specified by:
getPosition
in interface javax.mail.internet.SharedInputStream
- Returns:
- the current read position in the stream
newStream
public java.io.InputStream newStream(long start,
long end)
- Gets a new SharedInputStream as substream from this InputStream.
- Specified by:
newStream
in interface javax.mail.internet.SharedInputStream
- Parameters:
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
- Returns:
- the new stream sub stream
IAIK-CMS 6.0, (c) 2002 IAIK, (c) 2003, 2023 SIC