Package java.nio

Examples of java.nio.CharBuffer.rewind()


            // XXX
            if (op.setValue(metaData.getAttr(4), null) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));

            str.rewind();
            ndbjtieTranscode(bb, str);
            if (op.setValue(metaData.getAttr(5), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(5));
View Full Code Here


            ndbjtieTranscode(bb, str);
            if (op.setValue(metaData.getAttr(5), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(5));

            str.rewind();
            ndbjtieTranscode(bb, str);
            if (op.setValue(metaData.getAttr(6), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(6));
View Full Code Here

            ndbjtieTranscode(bb, str);
            if (op.setValue(metaData.getAttr(6), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(6));

            str.rewind();
            ndbjtieTranscode(bb, str);
            if (op.setValue(metaData.getAttr(7), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(7));
View Full Code Here

            ndbjtieTranscode(bb, str);
            if (op.setValue(metaData.getAttr(7), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(7));

            str.rewind();
            ndbjtieTranscode(bb, str);
            if (op.setValue(metaData.getAttr(8), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(8));
View Full Code Here

            if (op.setValue(metaData.getAttr(3), r) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));

            for(int i = 5; i < metaData.getColumnCount(); i++) {
            str1.rewind();
            ndbjtieTranscode(bb, str1);
            if (op.setValue(metaData.getAttr(i), bb) != 0)
                throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
            bb.position(bb.position() + metaData.getColumnWidth(i));
            }
View Full Code Here

         if (data.remaining() < wordLength) {
            wordLength = data.remaining();
         }
      }

      return data.rewind().toString();
   }

   /**
    *
    * Randomly selects a random length word based on the words array defined above
View Full Code Here

                /* Try to decode; if we fail, try another byte. */
                toDecode.position(0);
                CoderResult cr = dec.decode(toDecode, decoded, false);
                if (!cr.isError()) {
                    decoded.rewind();
                    return decoded.toString();
                }
            }
            throw new MalformedInputException(maxBytes);
        }
View Full Code Here

                      final SixModelObject done, final SixModelObject error) {
        try {
            String s_data = Ops.unbox_s(data, tc);
            CharBuffer s_buf = CharBuffer.allocate(s_data.length());
            s_buf.put(s_data);
            s_buf.rewind();

            SpurtState ss = new SpurtState();
            ss.bb = enc.encode(s_buf);
            ss.expected = ss.bb.remaining();
            ss.bb.rewind();
View Full Code Here

            do {
              sizeRead = fileReader.read(charBuffer.array(), 0, charBuffer.length());
              if (sizeRead != -1) {
                offset += sizeRead;
                text += charBuffer.subSequence(0, sizeRead);
                charBuffer.rewind();
              }
            } while (sizeRead != -1 && offset < fileSizeLimit);

            // complain if file size was too big after all - can happen if file size was impossible to be retrieved above
            if (offset >= fileSizeLimit) {
View Full Code Here

                    CoderResult res = cd.decode(bytes, chars, true);
                    if (res.isMalformed() || res.isUnmappable()) {
                        return true;
                    } else if (res.isOverflow()) {
                        chars.limit(chars.position());
                        chars.rewind();
                        int c = chars.capacity() * 2;
                        CharBuffer on = CharBuffer.allocate(c);
                        on.put(chars);
                        chars = on;
                    }
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.