javax.mail.util
クラス SharedByteArrayInputStream
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
javax.mail.util.SharedByteArrayInputStream
- すべての実装されたインタフェース:
- Closeable, SharedInputStream
public final class SharedByteArrayInputStream
- extends ByteArrayInputStream
- implements SharedInputStream
SharedInputStream インタフェースを実装する ByteArrayInputStream です。
基本的なバイト配列が複数のリーダ間で共有されるのを許可します。
- 導入されたバージョン:
- JavaMail 1.4
フィールドの概要 |
protected int |
start
Position within shared buffer that this stream starts at. |
コンストラクタの概要 |
SharedByteArrayInputStream(byte[] buf)
Create a SharedByteArrayInputStream representing the entire byte array. |
SharedByteArrayInputStream(byte[] buf,
int offset,
int length)
Create a SharedByteArrayInputStream representing the part of the byte array from offset for length bytes. |
メソッドの概要 |
long |
getPosition()
Return the current position in the InputStream, as an offset from the beginning of the InputStream. |
InputStream |
newStream(long start,
long end)
Return a new InputStream representing a subset of the data from this InputStream,
starting at start (inclusive) up to end (exclusive). |
クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
start
protected int start
- Position within shared buffer that this stream starts at.
SharedByteArrayInputStream
public SharedByteArrayInputStream(byte[] buf)
- Create a SharedByteArrayInputStream representing the entire byte array.
- パラメータ:
buf
- the byte array
SharedByteArrayInputStream
public SharedByteArrayInputStream(byte[] buf,
int offset,
int length)
- Create a SharedByteArrayInputStream representing the part of the byte array from offset for length bytes.
- パラメータ:
buf
- the byte arrayoffset
- offset in byte array to first byte to includelength
- number of bytes to include
getPosition
public long getPosition()
- Return the current position in the InputStream, as an offset from the beginning of the InputStream.
- 定義:
- インタフェース
SharedInputStream
内の getPosition
- 戻り値:
- 現在の位置
newStream
public InputStream newStream(long start,
long end)
- Return a new InputStream representing a subset of the data from this InputStream,
starting at start (inclusive) up to end (exclusive).
start must be non-negative.
If end is -1, the new stream ends at the same place as this stream.
The returned InputStream will also implement the SharedInputStream interface.
- 定義:
- インタフェース
SharedInputStream
内の newStream
- パラメータ:
start
- 開始位置end
- 終了位置 + 1
- 戻り値:
- 新しいストリーム