|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjava.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 内の readIOException - 入出力エラーが発生した場合
public int read(char[] b,
int off,
int len)
throws IOException
Reader 内の readb - 転送先バッファーoff - 文字の格納開始オフセットlen - 読み込む文字の最大数
IOException - 入出力エラーが発生した場合
public long skip(long n)
throws IOException
n パラメータには、Reader スーパークラスの skip メソッドが例外をスローする場合であっても、負を設定できます。n が負の場合、このメソッドは何もせずに 0 を返します。
Reader 内の skipn - スキップする文字数
IOException - ストリームが閉じられている場合、または入出力エラーが発生した場合
public boolean ready()
throws IOException
Reader 内の readyIOException - 入出力エラーが発生した場合public boolean markSupported()
Reader 内の markSupported
public void mark(int readAheadLimit)
throws IOException
Reader 内の markreadAheadLimit - マークを保持しながら読み込むことができる文字数の上限。ストリームには文字配列から入力されるので、実際の上限はない。そのため、この引数は無視される
IOException - 入出力エラーが発生した場合
public void reset()
throws IOException
Reader 内の resetIOException - 入出力エラーが発生した場合public void close()
Closeable 内の closeReader 内の close
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。