Package java.nio

Examples of java.nio.CharBuffer.position()


        cb = CharBuffer.allocate(20);
       
        ((CharsetDecoderICU)decoder).setToUCallback(CoderResult.OVERFLOW, CharsetCallback.TO_U_CALLBACK_ESCAPE, null)// This callback is not valid.
        for (int i = 0; i < context2.length; i++) {
            decoder.reset();
            cb.position(0);
            bb.position(0);
            ((CharsetDecoderICU)decoder).setToUCallback(CoderResult.malformedForLength(1), CharsetCallback.TO_U_CALLBACK_ESCAPE, context2[i]); // This callback is valid.
           
            result = decoder.decode(bb, cb, true);
            if (result.isError()) {
View Full Code Here


        }
       
        // Testing decoder skip callback
        for (int i = 0; i < context3.length; i++) {
            decoder.reset();
            cb.position(0);
            bb.position(0);
            ((CharsetDecoderICU)decoder).setToUCallback(CoderResult.malformedForLength(1), CharsetCallback.TO_U_CALLBACK_SKIP, context3[i]);
            result = decoder.decode(bb, cb, true);
            if (!result.isError()) {
                errln("Error occurred while testing of callbacks for ISO-2022-JP decoder should have occurred.");
View Full Code Here

        ByteBuffer bs = ByteBuffer.allocate(bs_array1.length);
       
        us.put(us_array);
        bs.put(bs_array1);
       
        us.limit(us.position());
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
           
        try {
View Full Code Here

       
        us.put(us_array);
        bs.put(bs_array1);
       
        us.limit(us.position());
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
           
        try {
            smBufDecode(decoder, "UTF32-DE-1", bs, us, true, false);
View Full Code Here

       
        bs = ByteBuffer.allocate(bs_array2.length);
        bs.put(bs_array2);
       
        us.limit(4);
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
           
        try {
            smBufDecode(decoder, "UTF32-DE-2", bs, us, true, false);
View Full Code Here

        us.clear();
       
        bs.put((byte)0x00); bs.put((byte)0xFE); bs.put((byte)0xFF); bs.put((byte)0x00); bs.put((byte)0x00);
        us.put((char)0x0000);
       
        us.limit(us.position());
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
       
        try {
View Full Code Here

       
        bs.put((byte)0x00); bs.put((byte)0xFE); bs.put((byte)0xFF); bs.put((byte)0x00); bs.put((byte)0x00);
        us.put((char)0x0000);
       
        us.limit(us.position());
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
       
        try {
            smBufDecode(decoder, "UTF32-DE-3", bs, us, true, false);
View Full Code Here

        us.clear();
       
        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFF); bs.put((byte)0xFE);
        us.put((char)0x0000);
       
        us.limit(us.position());
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
       
        try {
View Full Code Here

       
        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFF); bs.put((byte)0xFE);
        us.put((char)0x0000);
       
        us.limit(us.position());
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
       
        try {
            smBufDecode(decoder, "UTF32-DE-4", bs, us, true, false);
View Full Code Here

       
        //test wite BOM overflow error
        us.put((char)0xDC01);
        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
       
        us.limit(us.position());
        us.position(0);
        bs.limit(bs.position());
        bs.position(0);
       
        result = encoder.encode(us, bs, true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.