Package java.nio.charset

Examples of java.nio.charset.UnmappableCharacterException


                decoder.reset();
            }
            if (result.isMalformed()) {
                throw new MalformedInputException(result.length());
            } else if (result.isUnmappable()) {
                throw new UnmappableCharacterException(result.length());
            }

            return out.position() - offset == 0 ? -1 : out.position() - offset;
        }
    }
View Full Code Here


            content().writeBytes(((ReadOnlyAsciiBuf) csq).content());
        } else {
            for (int i = start; i < end; i++) {
                char c =  csq.charAt(i);
                if (c >= '\u0080') {
                    throw new UnmappableCharacterException(2);
                }
                content().writeByte((byte) c);
            }
        }
        return this;
View Full Code Here

    }

    @Override
    public Appendable append(char c) throws IOException {
        if (c >= '\u0080') {
            throw new UnmappableCharacterException(2);
        }
        content().writeByte((byte) c);
        return this;
    }
View Full Code Here

    public static ReadableCharBuf ascii(char[] values, int start, int length) {
        byte[] data = new byte[length];
        for (int i = start; i < (start + length); i++) {
            char c =  values[i];
            if (c >= '\u0080') {
                throw new RuntimeException(new UnmappableCharacterException(2));
            }
            data[i] = (byte) c;
        }
        return new ByteArrayReadOnlyAsciiBuf(data);
    }
View Full Code Here

        }

        if (result.isMalformed()) {
            throw new MalformedInputException(result.length());
        } else if (result.isUnmappable()) {
            throw new UnmappableCharacterException(result.length());
        }

        int rd = out.position() - offset;
        return rd == 0 ? -1 : rd;
    }
View Full Code Here

                decoder.reset();
            }
            if (result.isMalformed()) {
                throw new MalformedInputException(result.length());
            } else if (result.isUnmappable()) {
                throw new UnmappableCharacterException(result.length());
            }

            return out.position() - offset == 0 ? -1 : out.position() - offset;
        }
    }
View Full Code Here

TOP

Related Classes of java.nio.charset.UnmappableCharacterException

Copyright © 2018 www.massapicom. 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.