|
intra-mart 6.1.14 | ||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object java.io.Writer java.io.FilterWriter jp.co.intra_mart.foundation.utility.charset.AdvancedOutputStreamWriter
jp.co.intra_mart.common.aid.jdk.util.charset.AdvancedOutputStreamWriter
クラスを使用してください。
このクラスは、基礎となる java.io.OutputStreamWriter をフィルタリングした Writer 機能を提供します。
通常、ASCII の範囲に含まれない文字は、java.io.OutputStreamWriter を
利用して相互に文字コード変換した場合、各文字エンコーディングの
Unicode に対するマッピングの相違により、本来その文字エンコーディングにおいて
存在する文字であってもコード不明を意味する「?」に置き換えられてしまう
ことがあります。
いわゆる、この文字化けに対して、文字コード変換前に、
対象となる文字エンコーディングに対する Unicode の正しい文字に
置換することで、いくつかの文字については正しく文字コード変換することが
できます。
このクラスでは、この方式により文字化けを回避します。
文字化けに対する文字のマッピングおよび対応する文字エンコーディングに
関しては、CharacterEncoder
クラスの仕様に準じます。
jp.co.intra_mart.common.aid.jdk.util.charset.AdvancedOutputStreamWriter
,
jp.co.intra_mart.common.aid.jdk.util.charset.ResourceNotFoundException
,
jp.co.intra_mart.common.aid.jdk.util.charset.ResourceFormatException
,
CharacterEncoder
フィールドの概要 |
クラス java.io.FilterWriter から継承したフィールド |
out |
クラス java.io.Writer から継承したフィールド |
lock |
コンストラクタの概要 | |
AdvancedOutputStreamWriter(OutputStream out)
推奨されていません。 デフォルトの文字エンコーディングを使う AdvancedOutputStreamWriter を作成します。 |
|
AdvancedOutputStreamWriter(OutputStream out,
Charset cs)
推奨されていません。 与えられた文字エンコーディングを使う AdvancedOutputStreamWriter を作成します。 |
|
AdvancedOutputStreamWriter(OutputStream out,
CharsetEncoder enc)
推奨されていません。 与えられた文字エンコーディングエンコーダを使う AdvancedOutputStreamWriter を作成します。 |
|
AdvancedOutputStreamWriter(OutputStream out,
String charsetName)
推奨されていません。 指定された文字エンコーディングを使う AdvancedOutputStreamWriter を作成します。 |
|
AdvancedOutputStreamWriter(OutputStreamWriter writer)
推奨されていません。 OutputStreamWriter をフィルタリングする新しい AdvancedOutputStreamWriter を作成します。 |
メソッドの概要 | |
static jp.co.intra_mart.common.aid.jdk.util.charset.AdvancedOutputStreamWriter |
createWriter(OutputStreamWriter writer)
推奨されていません。 AdvancedOutputStreamWriter のスーパークラス AdvancedOutputStreamWriter を作成します。 |
String |
getCharacterEncoding()
推奨されていません。 このオブジェクトが対象としている文字エンコーディング名を返します。 |
OutputStreamWriter |
getOutputStreamWriter()
推奨されていません。 このオブジェクトの基礎出力となっている java.io.OutputStreamWriter を返します。 |
void |
write(char[] cbuf,
int off,
int len)
推奨されていません。 文字の配列の一部を書き込みます。 |
void |
write(int c)
推奨されていません。 単一の文字を書き込みます。 |
void |
write(String str,
int off,
int len)
推奨されていません。 文字列の一部を書き込みます。 |
クラス java.io.FilterWriter から継承したメソッド |
close, flush |
クラス java.io.Writer から継承したメソッド |
write, write |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
public AdvancedOutputStreamWriter(OutputStream out, String charsetName) throws UnsupportedEncodingException, ResourceNotFoundException, ResourceFormatException, IOException
out
- 基礎となる出力ストリームcharsetName
- サポートされる charset の名前
UnsupportedEncodingException
- 指定された文字エンコーディングがサポートされていない場合
NullPointerException
- 引数が null の場合
ResourceNotFoundException
- 対象となる文字エンコーディングに対応する設定がない場合
IOException
- 設定の読み込みエラー
ResourceFormatException
- 設定に不整合がある場合public AdvancedOutputStreamWriter(OutputStream out) throws ResourceFormatException, ResourceNotFoundException, IOException
out
- 基礎となる出力ストリーム
NullPointerException
- 引数が null の場合
ResourceNotFoundException
- 対象となる文字エンコーディングに対応する設定がない場合
IOException
- 設定の読み込みエラー
ResourceFormatException
- 設定に不整合がある場合public AdvancedOutputStreamWriter(OutputStream out, Charset cs) throws IOException, ResourceFormatException, ResourceNotFoundException
out
- 基礎となる出力ストリームcs
- サポートされる Charset
NullPointerException
- 引数が null の場合
ResourceNotFoundException
- 対象となる文字エンコーディングに対応する設定がない場合
IOException
- 入出力エラー
ResourceFormatException
- 設定に不整合がある場合public AdvancedOutputStreamWriter(OutputStream out, CharsetEncoder enc) throws ResourceFormatException, IOException, ResourceNotFoundException
out
- 基礎となる出力ストリームenc
- 文字エンコーディングエンコーダ
NullPointerException
- 引数が null の場合
ResourceNotFoundException
- 対象となる文字エンコーディングに対応する設定がない場合
IOException
- 設定の読み込みエラー
ResourceFormatException
- 設定に不整合がある場合public AdvancedOutputStreamWriter(OutputStreamWriter writer) throws ResourceNotFoundException, IOException, ResourceFormatException
なお、このオブジェクトが対応する文字エンコーディングは、 java.io.OutputStreamWriter#getEncoding() の返す値によって 決定します。 java.io.OutputStreamWriter#getEncoding() が null を返す場合、 このコンストラクタは NUllPointerException をスローして オブジェクトの作成に失敗します。
writer
- 基本となるストリームを提供する java.io.OutputStreamWriter オブジェクト
NullPointerException
- 引数が null の場合
jp.co.intra_mart.common.aid.jdk.util.charset.ResourceNotFoundException
- 対象となる文字エンコーディングに対応する設定がない場合
jp.co.intra_mart.common.aid.jdk.util.charset.ResourceFormatException
- 設定に不整合がある場合
IOException
- 設定の読み込みエラー
ResourceNotFoundException
ResourceFormatException
メソッドの詳細 |
public static jp.co.intra_mart.common.aid.jdk.util.charset.AdvancedOutputStreamWriter createWriter(OutputStreamWriter writer) throws IOException, ResourceNotFoundException, ResourceFormatException
writer
-
IOException
ResourceNotFoundException
ResourceFormatException
public String getCharacterEncoding()
public void write(char[] cbuf, int off, int len) throws IOException
cbuf
- き込む文字のバッファoff
- 文字の読み込み開始オフセットlen
- 書き込む文字数
IOException
- 入出力エラーが発生した場合public void write(int c) throws IOException
c
- 書き込む文字を指定する int
IOException
- 入出力エラーが発生した場合public void write(String str, int off, int len) throws IOException
str
- 書き込まれる文字列off
- 文字の読み込み開始オフセットlen
- 書き込む文字数
IOException
- 入出力エラーが発生した場合public OutputStreamWriter getOutputStreamWriter()
|
intra-mart 6.1.14 | ||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |