Examples of arrayOffset()


Examples of java.nio.ByteBuffer.arrayOffset()

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

      if (reader.getComparator().compare(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()

    @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()

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

Examples of java.nio.CharBuffer.arrayOffset()

        // new String(byte[], int, int, Charset) takes a defensive copy of the
        // entire byte array. This is expensive if only a small subset of the
        // bytes will be used. The code below is from Apache Harmony.
        CharBuffer cb;
        cb = charset.decode(ByteBuffer.wrap(buff, start, end-start));
        return new String(cb.array(), cb.arrayOffset(), cb.length());
    }

    public int getInt()
    {
        return Ascii.parseInt(buff, start,end-start);
View Full Code Here

Examples of net.minecraft.util.io.netty.buffer.ByteBuf.arrayOffset()

    protected ByteBuf a(ChannelHandlerContext channelhandlercontext, ByteBuf bytebuf) {
        int i = bytebuf.readableBytes();
        byte[] abyte = this.a(bytebuf);
        ByteBuf bytebuf1 = channelhandlercontext.alloc().heapBuffer(this.a.getOutputSize(i));

        bytebuf1.writerIndex(this.a.update(abyte, 0, i, bytebuf1.array(), bytebuf1.arrayOffset()));
        return bytebuf1;
    }

    protected void a(ByteBuf bytebuf, ByteBuf bytebuf1) {
        int i = bytebuf.readableBytes();
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.arrayOffset()

                {
                    data.put(payload);
                }
                else
                {
                    data.put(payload.array(), payload.arrayOffset(), payload.limit());
                }

                payload.release();
            }
View Full Code Here

Examples of org.elasticsearch.common.bytes.BytesArray.arrayOffset()

        if (compressor != null) {
            // already compressed...
            this.bytes = data.toBytes();
        } else {
            BytesArray bytesArray = data.toBytesArray();
            this.bytes = CompressorFactory.defaultCompressor().compress(bytesArray.array(), bytesArray.arrayOffset(), bytesArray.length());
        }
    }

    /**
     * Constructs a new compressed string, assuming the bytes are UTF8, by copying it over.
View Full Code Here

Examples of org.elasticsearch.common.bytes.BytesReference.arrayOffset()

        String[] indices = RestActions.splitIndices(request.param("index"));
        Carrot2Request searchRequest = new Carrot2Request(indices);
        // get the content, and put it in the body
        if (request.hasContent()) {
            BytesReference content = request.content();
            searchRequest.source(content.array(), content.arrayOffset(), content.length(), request.contentUnsafe());
        } else {
            String source = request.param("source");
            if (source != null) {
                searchRequest.source(source);
            }
View Full Code Here

Examples of org.glassfish.grizzly.Buffer.arrayOffset()

            if (!mm.willAllocateDirect(chunkSize)) {
                buffer = mm.allocate(chunkSize);
                final int len;
                if (!buffer.isComposite()) {
                    len = inputStream.read(buffer.array(),
                            buffer.position() + buffer.arrayOffset(),
                            chunkSize);
                } else {
                    final BufferArray bufferArray = buffer.toBufferArray();
                    final int size = bufferArray.size();
                    final Buffer[] buffers = bufferArray.getArray();
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.