Package java.nio

Examples of java.nio.CharBuffer.remaining()


                    case 0:
                        autoExpand((int) Math.ceil(in.remaining() * encoder.averageBytesPerChar()));
                        expandedState++;
                        break;
                    case 1:
                        autoExpand((int) Math.ceil(in.remaining() * encoder.maxBytesPerChar()));
                        expandedState++;
                        break;
                    default:
                        throw new RuntimeException("Expanded by "
                                + (int) Math.ceil(in.remaining() * encoder.maxBytesPerChar())
 
View Full Code Here


                        autoExpand((int) Math.ceil(in.remaining() * encoder.maxBytesPerChar()));
                        expandedState++;
                        break;
                    default:
                        throw new RuntimeException("Expanded by "
                                + (int) Math.ceil(in.remaining() * encoder.maxBytesPerChar())
                                + " but that wasn't enough for '" + val + "'");
                    }
                    continue;
                }
            }
View Full Code Here

                //
                int charsRead;
                int bytesRead;

                if (cb.remaining() == 0) {
                    cb.clear();

                    charsRead = m_reader.read(cb);

                    cb.flip();
View Full Code Here

                bb.clear();
                bb.put(b, off, len);
                bb.flip();
                m_decoder.decode(bb, cb, false);

                if (cb.remaining() == 0) {
                    flush();
                }
            }
            public void flush() throws IOException {
                checkClosed();
View Full Code Here

    }
    encodingBuffer.put(in);
    encodingBuffer.flip();

    CoderResult result = CoderResult.UNDERFLOW;
    if (encodingBuffer.remaining() > 0) {
      while (true) {
        CodingErrorAction action = null;
        try {
          result = encodeLoop(encodingBuffer, out);
        } catch (BufferOverflowException ex) {
View Full Code Here

         */
        if (result.isUnderflow()) {
          if (endOfInput) {
            if (encodingBuffer.hasRemaining()) {
              result = CoderResult
                  .malformedForLength(encodingBuffer
                      .remaining());
              encodingBuffer.position(encodingBuffer.limit());
            }
          } else {
            if (encodingBuffer.hasRemaining()) {
View Full Code Here

                      .remaining());
              encodingBuffer.position(encodingBuffer.limit());
            }
          } else {
            if (encodingBuffer.hasRemaining()) {
              remains = new char[encodingBuffer.remaining()];
              encodingBuffer.get(remains);
            }
          }
        }
        // set coding error handle action
View Full Code Here

            }
            if (cr.isOverflow()) {
                if (isAutoExpand()) {
                    switch (expandedState) {
                    case 0:
                        autoExpand((int) Math.ceil(in.remaining()
                                * encoder.averageBytesPerChar()));
                        expandedState++;
                        break;
                    case 1:
                        autoExpand((int) Math.ceil(in.remaining()
View Full Code Here

                        autoExpand((int) Math.ceil(in.remaining()
                                * encoder.averageBytesPerChar()));
                        expandedState++;
                        break;
                    case 1:
                        autoExpand((int) Math.ceil(in.remaining()
                                * encoder.maxBytesPerChar()));
                        expandedState++;
                        break;
                    default:
                        throw new RuntimeException("Expanded by "
View Full Code Here

                                * encoder.maxBytesPerChar()));
                        expandedState++;
                        break;
                    default:
                        throw new RuntimeException("Expanded by "
                                + (int) Math.ceil(in.remaining()
                                        * encoder.maxBytesPerChar())
                                + " but that wasn't enough for '" + val + "'");
                    }
                    continue;
                }
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.