Examples of arrayOffset()


Examples of java.nio.ByteBuffer.arrayOffset()

        byte[] token;
        // synchronization may be needed since there can be multiple Handler
        // threads using saslServer to wrap responses.
        synchronized (((SecureConnection)connection).saslServer) {
          token = ((SecureConnection)connection).saslServer.wrap(buf.array(),
              buf.arrayOffset(), buf.remaining());
        }
        if (LOG.isTraceEnabled()) {
          LOG.trace("Adding saslServer wrapped token of size " + token.length
              + " as call response.");
        }
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

        ByteBuffer b = midLeafBlock.getBufferWithoutHeader();
        int numDataBlocks = b.getInt();
        int keyRelOffset = b.getInt(Bytes.SIZEOF_INT * (midKeyEntry + 1));
        int keyLen = b.getInt(Bytes.SIZEOF_INT * (midKeyEntry + 2)) -
            keyRelOffset;
        int keyOffset = b.arrayOffset() +
            Bytes.SIZEOF_INT * (numDataBlocks + 2) + keyRelOffset +
            SECONDARY_INDEX_ENTRY_OVERHEAD;
        targetMidKey = Arrays.copyOfRange(b.array(), keyOffset, keyOffset + keyLen);
      } else {
        // The middle of the root-level index.
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

          return b;
        }
        // constrain the bottom.
        if (!top) {
          ByteBuffer bb = getKey();
          if (getComparator().compareFlatKey(bb.array(), bb.arrayOffset(), bb.limit(),
              splitkey, 0, splitkey.length) >= 0) {
            atEnd = true;
            return false;
          }
        }
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

          return b;
        }
        // Check key.
        ByteBuffer k = this.delegate.getKey();
        return this.delegate.getReader().getComparator().
          compareFlatKey(k.array(), k.arrayOffset(), k.limit(),
            splitkey, 0, splitkey.length) < 0;
      }

      public int seekTo(byte[] key) throws IOException {
        return seekTo(key, 0, key.length);
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

    @Override
    public String getKeyString() {
      ByteBuffer keyBuffer = getKey();
      return Bytes.toStringBinary(keyBuffer.array(),
          keyBuffer.arrayOffset(), keyBuffer.limit());
    }

    @Override
    public String getValueString() {
      ByteBuffer valueBuffer = getValue();
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

    @Override
    public String getValueString() {
      ByteBuffer valueBuffer = getValue();
      return Bytes.toStringBinary(valueBuffer.array(),
          valueBuffer.arrayOffset(), valueBuffer.limit());
    }

    private void assertValidSeek() {
      if (block == null) {
        throw new NotSeekedException();
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

    public int reseekTo(byte[] key, int offset, int length) throws IOException {
      int compared;
      if (isSeeked()) {
        ByteBuffer bb = getKey();
        compared = reader.getComparator().compareFlatKey(key, offset,
            length, bb.array(), bb.arrayOffset(), bb.limit());
        if (compared < 1) {
          // If the required key is less than or equal to current key, then
          // don't do anything.
          return compared;
        } else {
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

        return false;
      }
      ByteBuffer firstKey = getFirstKeyInBlock(seekToBlock);

      if (reader.getComparator().compareFlatKey(firstKey.array(),
          firstKey.arrayOffset(), firstKey.limit(), key, offset, length) == 0)
      {
        long previousBlockOffset = seekToBlock.getPrevBlockOffset();
        // The key we are interested in
        if (previousBlockOffset == -1) {
          // we have a 'problem', the key we want is the first of the file.
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

        byte[] token;
        // synchronization may be needed since there can be multiple Handler
        // threads using saslServer to wrap responses.
        synchronized (connection.saslServer) {
          token = connection.saslServer.wrap(buf.array(),
              buf.arrayOffset(), buf.remaining());
        }
        if (LOG.isDebugEnabled())
          LOG.debug("Adding saslServer wrapped token of size " + token.length
              + " as call response.");
        buf.clear();
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

                    if (lastRow != null)
                    {
                        if (tuple.size() == 0) // lastRow is a new one
                        {
                            key = (ByteBuffer)reader.getCurrentKey();
                            tuple.append(new DataByteArray(key.array(), key.position()+key.arrayOffset(), key.limit()+key.arrayOffset()));
                        }
                        for (Map.Entry<ByteBuffer, IColumn> entry : lastRow.entrySet())
                        {
                            bag.add(columnToTuple(entry.getValue(), cfDef, parseType(cfDef.getComparator_type())));
                        }
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.