|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object java.io.Reader java.io.CharArrayReader
public class CharArrayReader
文字入力ストリームとして使用する文字バッファを実装します。
フィールドの概要 | |
---|---|
protected char[] |
buf
文字バッファです。 |
protected int |
count
このバッファの最後のインデックスです。 |
protected int |
markedPos
バッファ内のマーク位置です。 |
protected int |
pos
現在のバッファの位置です。 |
クラス java.io.Reader から継承されたフィールド |
---|
lock |
コンストラクタの概要 | |
---|---|
CharArrayReader(char[] buf)
指定された文字の配列から CharArrayReader を作成します。 |
|
CharArrayReader(char[] buf,
int offset,
int length)
指定された文字の配列から CharArrayReader を作成します。 |
メソッドの概要 | |
---|---|
void |
close()
ストリームを閉じます。 |
void |
mark(int readAheadLimit)
ストリームの現在位置にマークを設定します。 |
boolean |
markSupported()
このストリームが、実行する mark() 操作をサポートするかどうかを通知します。 |
int |
read()
単一の文字を読み込みます。 |
int |
read(char[] b,
int off,
int len)
配列の一部に文字を読み込みます。 |
boolean |
ready()
ストリームが読み込み可能な状態かどうかを通知します。 |
void |
reset()
直前のマーク位置にストリームをリセットします。 |
long |
skip(long n)
文字をスキップします。 |
クラス java.io.Reader から継承されたメソッド |
---|
read, read |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
protected char[] buf
protected int pos
protected int markedPos
protected int count
コンストラクタの詳細 |
---|
public CharArrayReader(char[] buf)
buf
- 入力バッファ (コピーされていない)public CharArrayReader(char[] buf, int offset, int length)
リーダは、指定のoffset 位置から読み取りを開始します。このリーダから読み取ることができる char 値の合計数は、length または buf.length-offset の値の小さいほうに一致します。
buf
- 入力バッファ (コピーされていない)offset
- 読み込む最初の文字オフセットlength
- 読み込む文字数
IllegalArgumentException
- offset が負の数であるか buf.length より大きい場合、length が負の数の場合、またはこれらの 2 つの値の合計が負の数の場合メソッドの詳細 |
---|
public int read() throws IOException
Reader
内の read
IOException
- 入出力エラーが発生した場合public int read(char[] b, int off, int len) throws IOException
Reader
内の read
b
- 転送先バッファoff
- 文字の格納開始オフセットlen
- 読み込む文字の最大数
IOException
- 入出力エラーが発生した場合public long skip(long n) throws IOException
Reader
スーパークラスの skip
メソッドが例外をスローする場合でも、n
パラメータには負の数を指定できます。n
に負の数を指定した場合、このメソッドは何も行わず、0
を返します。
Reader
内の skip
n
- スキップする文字数
IOException
- ストリームが閉じている場合、または入出力エラーが発生した場合public boolean ready() throws IOException
Reader
内の ready
IOException
- 入出力エラーが発生した場合public boolean markSupported()
Reader
内の markSupported
public void mark(int readAheadLimit) throws IOException
Reader
内の mark
readAheadLimit
- マークを保持しながら読み込むことができる文字数の上限。ストリームには文字配列から入力されるので、実際の上限はない。そのため、この引数は無視される
IOException
- 入出力エラーが発生した場合public void reset() throws IOException
Reader
内の reset
IOException
- 入出力エラーが発生した場合public void close()
Closeable
内の close
Reader
内の close
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。