4.3. CharsetEncoderクラス CharsetEncoderクラスはUnicode文字列を各種文字セットの文字列に変換するためのクラスです。CharsetEncoderインスタンスは、対応するCharsetインスタンスのnewEncoder()メソッドを呼び出すことによって取得できます。 文字列のエンコードを行うためのメソッドは、以下の2つ存在します。 CoderResult encode(CharBuffer in, ByteBuffer out, boolean endOfInput) ByteBuffer encode(CharBuffer in) まず、1番目の3つの引数を持った encode メソッドを使用した場合のエンコード手順を説明します。 resetメソッドを呼び出し、エンコーダをリセットする。 入力がなくなるまで繰り返しencodeメソッドを呼び出す。enc