Rdr2IS(Reader rdr, String charSet) : base(InputStream.InputStreamNull) { this.rdr = rdr; encoder = CharSet.forName(charSet).newEncoder(); encoder.onMalformedInput(CodingErrorAction.REPLACE); encoder.onUnmappableCharacter(CodingErrorAction.REPLACE); /* ** Initialize input/output buffers as empty so that ** the first read() request will proceed to fill them. ** The initial buffer state is clear() for reading, ** so simply flip() ready for writing. */ inBuff.flip(); outBuff.flip(); } // Rdr2IS
/* ** Name: Rdr2IS ** ** Description: ** Class constructor. ** ** Input: ** rdr Reader. ** charSet Character-set name. ** ** Output: ** None. ** ** Returns: ** None. ** ** History: ** 12-Sep-03 (gordy) ** Created. */ public Rdr2IS( Reader rdr, String charSet ) : base(InputStream.InputStreamNull) { this.rdr = rdr; encoder = CharSet.forName( charSet ).newEncoder(); encoder.onMalformedInput( CodingErrorAction.REPLACE ); encoder.onUnmappableCharacter( CodingErrorAction.REPLACE ); /* ** Initialize input/output buffers as empty so that ** the first read() request will proceed to fill them. ** The initial buffer state is clear() for reading, ** so simply flip() ready for writing. */ inBuff.flip(); outBuff.flip(); }