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.
 
クラス java.io.ByteArrayInputStream から継承されたフィールド
buf, count, mark, pos
 
コンストラクタの概要
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.io.ByteArrayInputStream から継承されたメソッド
available, close, mark, markSupported, read, read, reset, skip
 
クラス java.io.InputStream から継承されたメソッド
read
 
クラス 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 array
offset - offset in byte array to first byte to include
length - 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
戻り値:
新しいストリーム