Package org.jcodings

Examples of org.jcodings.Encoding.maxLength()


    public final RubyString catAscii(byte[]bytes, int p, int len) {
        Encoding enc = value.getEncoding();
        if (enc.isAsciiCompatible()) {
            cat(bytes, p, len, enc, CR_7BIT);
        } else {
            byte buf[] = new byte[enc.maxLength()];
            int end = p + len;
            while (p < end) {
                int c = bytes[p];
                int cl = codeLength(getRuntime(), enc, c);
                enc.codeToMbc(c, buf, 0);
View Full Code Here


    public final RubyString catAscii(byte[]bytes, int p, int len) {
        Encoding enc = value.getEncoding();
        if (enc.isAsciiCompatible()) {
            cat(bytes, p, len, enc, CR_7BIT);
        } else {
            byte buf[] = new byte[enc.maxLength()];
            int end = p + len;
            while (p < end) {
                int c = bytes[p];
                int cl = codeLength(getRuntime(), enc, c);
                enc.codeToMbc(c, buf, 0);
View Full Code Here

    public final RubyString catAscii(byte[]bytes, int ptr, int ptrLen) {
        Encoding enc = value.getEncoding();
        if (enc.isAsciiCompatible()) {
            EncodingUtils.encCrStrBufCat(getRuntime(), this, new ByteList(bytes, ptr, ptrLen), enc, CR_7BIT, null);
        } else {
            byte buf[] = new byte[enc.maxLength()];
            int end = ptr + ptrLen;
            while (ptr < end) {
                int c = bytes[ptr];
                int len = codeLength(getRuntime(), enc, c);
                EncodingUtils.encMbcput(c, buf, 0, enc);
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.