Examples of position()


Examples of java.nio.ShortBuffer.position()

  }

  private static ShortBuffer doNoCopyWrap(ShortBuffer buffer) {
    ShortBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static IntBuffer doNoCopyWrap(IntBuffer buffer) {
    IntBuffer direct_buffer = lookupBuffer(buffer);
View Full Code Here

Examples of java.nio.channels.FileChannel.position()

        long remainingInFile = fc.size()-offset;
        long remainingInTargetBuffer = buffer.remaining(DirectByteBuffer.SS_FILE);
        MappedByteBuffer buf = fc.map(MapMode.READ_ONLY, offset, Math.min(remainingInFile,remainingInTargetBuffer));
        buffer.put(DirectByteBuffer.SS_FILE, buf);
      } else {
        fc.position(offset);
        while (fc.position() < fc.size() && buffer.hasRemaining(DirectByteBuffer.SS_FILE))
          buffer.read(DirectByteBuffer.SS_FILE,fc);       
      }

     
View Full Code Here

Examples of java.nio.channels.FileLock.position()

    synchronized void addLock(FileLock lock)
            throws OverlappingFileLockException {
        long lockEnd = lock.position() + lock.size();
        for (Iterator<FileLock> keyItr = locks.iterator(); keyItr.hasNext();) {
            FileLock existingLock = keyItr.next();
            if (existingLock.position() > lockEnd) {
                // This, and all remaining locks, start beyond our end (so
                // cannot overlap).
                break;
            }
            if (existingLock.overlaps(lock.position(), lock.size())) {
View Full Code Here

Examples of java.nio.channels.ReadableByteChannel.position()

                    }
                } else {
                    FileChannel from = io1.openFile.fileChannel();
                    WritableByteChannel to = io2.openFile.writeChannel();
                    long remaining = length == null ? from.size() : length.getLongValue();
                    long position = offset == null ? from.position() : offset.getLongValue();

                    size = transfer(from, to, remaining, position);
                }

                return context.runtime.newFixnum(size);
View Full Code Here

Examples of java.nio.channels.SeekableByteChannel.position()

        if (storePosition < channel.size()) {
          LOG.warn("Found {} with size {} and position {}, resetting to 0", logfile, channel.size(), storePosition);
          savePosition(0);
        } else {
          channel.position(previousPosition.get());
        }
      }
      return channel;
    } catch (IOException e) {
      throw Throwables.propagate(e);
View Full Code Here

Examples of java.sql.Blob.position()

                    TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
                }
                // 0 or negative position value
                try
                {
                    blob.position(new byte[0],-4000);
                }
            catch (SQLException e)
                {
              TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
            }
View Full Code Here

Examples of java.sql.Clob.position()

                    if (tmp.indexOf(searchString) != -1) {
                        startSearchPos = start;
                    }
                    println("startSearchPos: " + startSearchPos +
                            "searchString: " + searchString);
                    foundAt = clob.position(searchString, startSearchPos);
                    assertEquals("FAIL - wrong match found for " +
                            searchString + " start at " + startSearchPos +
                            " with length " + searchString.length(),
                            start, foundAt);
                }
View Full Code Here

Examples of javarepl.completion.CompletionResult.position()

    public void returnsCompletions() throws Exception {
        client.execute("life = 42");
        CompletionResult result = client.completions("li");

        assertThat(result.expression(), is("li"));
        assertThat(result.position(), is(0));
        assertThat(result.candidates().map(candidateValue()), is(one("life")));
    }


    @Test
View Full Code Here

Examples of javax.sql.rowset.serial.SerialClob.position()

    }

    public void testPositionLStringJ() throws Exception {
        SerialClob serialClob = new SerialClob("helloo".toCharArray());

        long pos = serialClob.position("llo", 1);
        assertEquals(3, pos);

        pos = serialClob.position("llo", 3);
        assertEquals(3, pos);
View Full Code Here

Examples of krati.io.DataReader.position()

    Chronos c = new Chronos();
    DataReader r = IOFactory.createDataReader(_file, _type);
   
    try {
      r.open();
      r.position(DATA_START_POSITION);
     
      for (int i = 0; i < _arrayLength; i++) {
        intArray.set(i, r.readInt());
      }
     
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.