Refine search
final CoderResult coderResult = decoder.decode(src, oneChar, false); if (coderResult.isUnderflow()) { if (oneChar.hasRemaining()) { return false; } else if (oneChar.hasRemaining()) { throw new IllegalStateException(); final char ch = oneChar.get(0); builder.append(ch); if (ch == delimiter) {
while (cb.hasRemaining()) { final char c = cb.get(); if (c == '%' && cb.remaining() >= 2) { final char uc = cb.get(); final char lc = cb.get(); final int u = Character.digit(uc, 16); final int l = Character.digit(lc, 16);
if (charBuf.hasRemaining()) { char c = charBuf.get(); incrPosition(delta, true); return c; char highSurrogate = charBuf.get(); lowSurrogate = charBuf.get();
private void charToIntBuffer(int toAppend) { charBuffer.flip(); // IntBuffers hold two times as much per unit as ByteBuffers, so start with one half the capacity. IntBuffer newBuffer = IntBuffer.allocate(Math.max(charBuffer.remaining() + toAppend, charBuffer.capacity() / 2)); while (charBuffer.hasRemaining()) { newBuffer.put(charBuffer.get() & 0xFFFF); } type = Type.INT; charBuffer = null; intBuffer = newBuffer; } }
private void _encodeLeftoverChar( CharBuffer inputCharBuffer, boolean endOfInput) throws IOException { if (_inputCharBuffer.position() == 0) { return; } if ((_inputCharBuffer.position() == 1) && inputCharBuffer.hasRemaining()) { _inputCharBuffer.put(inputCharBuffer.get()); } _inputCharBuffer.flip(); _encodeLoop(_inputCharBuffer, endOfInput); _inputCharBuffer.compact(); }
private void _encodeLoop(CharBuffer inputCharBuffer, boolean endOfInput) throws IOException { while (inputCharBuffer.hasRemaining()) { CoderResult coderResult = _charsetEncoder.encode( inputCharBuffer, _outputByteBuffer, endOfInput); if (coderResult.isError()) { coderResult.throwException(); } if (coderResult.isUnderflow()) { if (_autoFlush) { _flushBuffer(); } if ((_inputCharBuffer != inputCharBuffer) && inputCharBuffer.hasRemaining()) { _inputCharBuffer.put(inputCharBuffer.get()); } break; } // Must be overflow, no need to check _flushBuffer(); } }
if (result.isError() || !_cb.hasRemaining()) return REPLACEMENT; return _cb.get() & 0xffff;
private void flushNextChars(CharBuffer cb) { while (nextChars.hasRemaining() && cb.hasRemaining()) cb.put(nextChars.get()); if (!nextChars.hasRemaining()) nextChars = null; }
@Override public int read() { if (!cb.hasRemaining()) { return -1; } return cb.get(); }
@Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; }
@Override public int read() { if (!cb.hasRemaining()) { return -1; } return cb.get(); }
@Override public int read() { if (!cb.hasRemaining()) { return -1; } return cb.get(); }
@Override public int read() { if (!cb.hasRemaining()) { return -1; } return cb.get(); }
@Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; }
@Override public int read() { if (!cb.hasRemaining()) { return -1; } return cb.get(); }
@Override public int read() { if (!cb.hasRemaining()) { return -1; } return cb.get(); }
private char getNextFormatChar() { if (format.hasRemaining()) { return format.get(); } return EOS; }
@Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; }
@Override public int read() { if (!cb.hasRemaining()) { return -1; } return cb.get(); }
@Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; }