Code example for CharsetDecoder

Methods: decodereset

0
     * ----------------------------------- 
     */ 
    // Normal case: just after reset, and it also means reset can be done 
    // anywhere 
    public void testResetIllegalState() throws CharacterCodingException {
        decoder.reset();
        decoder.decode(getByteBuffer());
        decoder.reset();
        decoder.decode(getByteBuffer(), CharBuffer.allocate(3), false);
        decoder.reset();
        decoder.decode(getByteBuffer(), CharBuffer.allocate(3), true);
        decoder.reset();
    } 
 
    public void testFlushIllegalState() throws CharacterCodingException {
        ByteBuffer in = ByteBuffer.wrap(new byte[] { 98, 98 });
        CharBuffer out = CharBuffer.allocate(5);
 
        // Illegal state: after reset. 
        decoder.reset();