private ByteArrayInputStream reEncode(Reader reader) throws IOException { int count; do{ count = reader.read(decodedBuffer_, 0, decodedBuffer_.length); }while(count == 0); if(count < 0) return null; encodedOutputStream_.reset(); encodedStreamWriter_.write(decodedBuffer_,0,count); encodedStreamWriter_.flush(); int encodedLength = encodedOutputStream_.size(); return new ByteArrayInputStream(encodedOutputStream_.getBuffer(), 0, encodedLength); }
private ByteArrayInputStream reEncode(Reader reader) throws IOException { int count; do{ count = reader.read(decodedBuffer_, 0, decodedBuffer_.length); }while(count == 0); if(count < 0) return null; encodedOutputStream_.reset(); encodedStreamWriter_.write(decodedBuffer_,0,count); encodedStreamWriter_.flush(); int encodedLength = encodedOutputStream_.size(); return new ByteArrayInputStream(encodedOutputStream_.getBuffer(), 0, encodedLength); }