|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
java.lang.Objectjp.go.nict.langrid.commons.io.StreamUtil
public final class StreamUtil
ストリーム関連処理を集めたユーティリティクラス。
| コンストラクタの概要 | |
|---|---|
StreamUtil()
|
|
| メソッドの概要 | |
|---|---|
static Reader |
createUTF8Reader(InputStream is)
UTF-8キャラクタエンコーディングを使用してストリームを読み込むリーダを作成する。 |
static Writer |
createUTF8Writer(OutputStream os)
UTF-8キャラクタエンコーディングを使用してストリームに書き込むライターを作成する。 |
static byte[] |
readAsBytes(InputStream is)
指定されたストリームの内容を読み込みバイト列として返す。 |
static byte[] |
readAsBytes(InputStream is,
int count)
指定されたストリームの内容を読み込みバイト列として返す。 |
static String |
readAsString(InputStream is,
CharsetDecoder decoder)
指定されたストリームの内容を指定されたデコーダを介して読み込み、Stringとして返す。 |
static String |
readAsString(InputStream is,
String encodingName)
指定されたストリームの内容を指定されたエンコーディングで読み込み、Stringとして返す。 |
static String |
readAsString(Reader reader)
指定されたReaderの内容を読み込み、Stringとして返す。 |
static int |
transfer(InputStream is,
OutputStream os)
ストリームの内容を転送する。 |
static int |
transfer(InputStream is,
OutputStream os,
int count)
指定されたバイト数だけストリームの内容を転送する。 |
static int |
transfer(Reader reader,
Writer writer)
readerの内容をwriterへ転送する。 |
static void |
writeString(OutputStream os,
String string,
CharsetEncoder encoder)
指定された文字列を指定されたエンコーダでバイト列に変換してストリームに書き出す。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public StreamUtil()
| メソッドの詳細 |
|---|
public static String readAsString(InputStream is,
CharsetDecoder decoder)
throws IOException
is - 読み込むストリームdecoder - 使用するデコーダ
IOException - 情報の読み込みに失敗した
public static String readAsString(InputStream is,
String encodingName)
throws IOException
is - 読み込むストリームencodingName - エンコーディング名
IOException - 情報の読み込みに失敗した
public static String readAsString(Reader reader)
throws IOException
reader - 読み込むReader
IOException - 情報の読み込みに失敗した
public static byte[] readAsBytes(InputStream is)
throws IOException
is - 読み込むストリーム
IOException - 情報の読み込みに失敗した
public static byte[] readAsBytes(InputStream is,
int count)
throws IOException
is - 読み込むストリームcount - 読み込むバイト数
IOException - 情報の読み込みに失敗した
public static void writeString(OutputStream os,
String string,
CharsetEncoder encoder)
throws IOException
os - 書き出すストリームstring - 書き出す文字列encoder - 使用するエンコーダ
IOException - 文字列の書き込みに失敗したpublic static Reader createUTF8Reader(InputStream is)
is - 読み込みを行うストリーム
public static Writer createUTF8Writer(OutputStream os)
os - 書き込みを行うストリーム
public static int transfer(InputStream is,
OutputStream os)
throws IOException
is - 入力os - 出力
IOException - 入出力に失敗した
public static int transfer(InputStream is,
OutputStream os,
int count)
throws IOException
is - 入力os - 出力count - 転送するバイト数
IOException - 入出力に失敗した
public static int transfer(Reader reader,
Writer writer)
throws IOException
reader - readerwriter - writer
IOException - 入出力に失敗した
|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||