private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { int mark = src.position(); try { while (src.hasRemaining()) { char c = src.get(); if (Surrogate.is(c)) { if (sgp.parse(c, src) < 0) return sgp.error(); return sgp.unmappableResult(); } if (c >= '\uFFFE') return CoderResult.unmappableForLength(1); if (!dst.hasRemaining()) return CoderResult.OVERFLOW; char e = index2.charAt(index1[(c & mask1) >> shift] + (c & mask2)); // If output byte is zero because input char is zero // then character is mappable, o.w. fail if (e == '\u0000' && c != '\u0000') return CoderResult.unmappableForLength(1); mark++; dst.put((byte)e); } return CoderResult.UNDERFLOW; } finally { src.position(mark); } }
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { int mark = src.position(); try { while (src.hasRemaining()) { char c = src.get(); if (Surrogate.is(c)) { if (sgp.parse(c, src) < 0) return sgp.error(); return sgp.unmappableResult(); } if (c >= '\uFFFE') return CoderResult.unmappableForLength(1); if (!dst.hasRemaining()) return CoderResult.OVERFLOW; char e = index2.charAt(index1[(c & mask1) >> shift] + (c & mask2)); // If output byte is zero because input char is zero // then character is mappable, o.w. fail if (e == '\u0000' && c != '\u0000') return CoderResult.unmappableForLength(1); mark++; dst.put((byte)e); } return CoderResult.UNDERFLOW; } finally { src.position(mark); } }
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { int mark = src.position(); try { while (src.hasRemaining()) { char c = src.get(); if (Surrogate.is(c)) { if (sgp.parse(c, src) < 0) return sgp.error(); return sgp.unmappableResult(); } if (c >= '\uFFFE') return CoderResult.unmappableForLength(1); if (!dst.hasRemaining()) return CoderResult.OVERFLOW; char e = index2.charAt(index1[(c & mask1) >> shift] + (c & mask2)); // If output byte is zero because input char is zero // then character is mappable, o.w. fail if (e == '\u0000' && c != '\u0000') return CoderResult.unmappableForLength(1); mark++; dst.put((byte)e); } return CoderResult.UNDERFLOW; } finally { src.position(mark); } }
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { int mark = src.position(); try { while (src.hasRemaining()) { char c = src.get(); if (Surrogate.is(c)) { if (sgp.parse(c, src) < 0) return sgp.error(); return sgp.unmappableResult(); } if (c >= '\uFFFE') return CoderResult.unmappableForLength(1); if (!dst.hasRemaining()) return CoderResult.OVERFLOW; char e = index2.charAt(index1[(c & mask1) >> shift] + (c & mask2)); // If output byte is zero because input char is zero // then character is mappable, o.w. fail if (e == '\u0000' && c != '\u0000') return CoderResult.unmappableForLength(1); mark++; dst.put((byte)e); } return CoderResult.UNDERFLOW; } finally { src.position(mark); } }
da[dp++] = (byte) (0xC0 | (c >> 6)); da[dp++] = (byte) (0x80 | (c & 0x3F)); } else if (Surrogate.is(c)) { int uc = sgp.parse((char) c, sa, lastSp, sl); if (uc < 0) {
while (sp < sl) { char c = sa[sp]; if (Surrogate.is(c)) { if (sgp.parse(c, sa, sp, sl) < 0) return sgp.error();
while (sp < sl) { char c = sa[sp]; if (Surrogate.is(c)) { if (sgp.parse(c, sa, sp, sl) < 0) return sgp.error();
while (sp < sl) { char c = sa[sp]; if (Surrogate.is(c)) { if (sgp.parse(c, sa, sp, sl) < 0) return sgp.error();
while (sp < sl) { char c = sa[sp]; if (Surrogate.is(c)) { if (sgp.parse(c, sa, sp, sl) < 0) return sgp.error();
putByte(dAddress, dp++, (byte) (0xC0 | (c >> 6))); putByte(dAddress, dp++, (byte) (0x80 | (c & 0x3F))); } else if (Surrogate.is(c)) { int uc = sgp.parse((char) c, sa, lastSp, sl); if (uc < 0) {