Examples of flip()


Examples of net.rubyeye.xmemcached.buffer.IoBuffer.flip()

    buffer.order(ByteOrder.LITTLE_ENDIAN);
    assertEquals(ByteOrder.LITTLE_ENDIAN, buffer.order());
    buffer.order(ByteOrder.BIG_ENDIAN);

    buffer.position(4);
    buffer.flip();
    assertEquals(0, buffer.position());
    assertEquals(4, buffer.limit());
    assertEquals(4, buffer.remaining());
   
    buffer.clear();
View Full Code Here

Examples of net.sf.cindy.Buffer.flip()

            random.nextBytes(b);

            Buffer buffer = newBuffer(b.length);
            buffer.put(b);
            assertEquals(b.length, buffer.position());
            buffer.flip();
            assertEquals(0, buffer.position());
            assertEquals(b.length, buffer.limit());
            assertEquals(b.length, buffer.capacity());
            assertEquals(b.length, buffer.remaining());
            assertTrue(buffer.hasRemaining());
View Full Code Here

Examples of org.activeio.Packet.flip()

        for(int i=0; i < 256; i++) {
            assertTrue(packet.write(i));
        }
        assertFalse(packet.write(0));
       
        packet.flip();
        for(int i=0; i < 256; i++) {
            assertEquals(i, packet.read());
        }      
        assertEquals(-1, packet.read());       
    }
View Full Code Here

Examples of org.activeio.packet.ByteArrayPacket.flip()

    private Packet createHeaderPacket(byte type, short requestId) throws IOException {
        ByteArrayPacket header = new ByteArrayPacket(new byte[]{3});
        PacketData data = new PacketData(header);
        data.writeByte(type);
        data.writeShort(requestId);
        header.flip();
        return header;
    }

    public void setRequestListener(RequestListener requestListener) throws IOException {
        this.requestListener = requestListener;       
View Full Code Here

Examples of org.apache.cassandra.io.util.DataOutputBuffer.flip()

        ByteBuffer buffer = ByteBuffer.allocate(4 + 4 + 4 + bytes.length);
        buffer.putInt(PROTOCOL_MAGIC);
        buffer.putInt(header);
        buffer.putInt(bytes.length);
        buffer.put(bytes);
        buffer.flip();
        return buffer;
    }

    public int incrementDroppedMessages(StorageService.Verb verb)
    {
View Full Code Here

Examples of org.apache.coyote.ByteBufferHolder.flip()

        while (responseMsgPos == -1 && bufferedWrites.size() > 0) {
            // Try and write any remaining buffer data
            Iterator<ByteBufferHolder> holders = bufferedWrites.iterator();
            ByteBufferHolder holder = holders.next();
            holder.flip();
            ByteBuffer buffer = holder.getBuf();
            int initialBufferSize = buffer.remaining();
            while (responseMsgPos == -1 && buffer.remaining() > 0) {
                transferToResponseMsg(buffer);
                writeResponseMessage(false);
View Full Code Here

Examples of org.apache.flink.runtime.io.disk.SpillingBuffer.flip()

      generator.next(rec);
      rec.write(outView);
    }
   
    // create the reader input view
    DataInputView inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    final Record readRec = new Record();
    for (int i = 0; i < NUM_PAIRS_INMEM; i++) {
View Full Code Here

Examples of org.apache.hadoop.hive.ql.udf.generic.GenericUDF.flip()

    ExprNodeDesc[] extracted = ExprNodeDescUtils.extractComparePair(expr1, expr2);
    if (extracted == null) {
      return expr;
    }
    if (extracted.length > 2) {
      genericUDF = genericUDF.flip();
    }

    String udfName = genericUDF.getUdfName();
    if (!udfNames.contains(genericUDF.getUdfName())) {
      return expr;
View Full Code Here

Examples of org.apache.hama.bsp.message.io.SpilledByteBuffer.flip()

      spillBuffer.markEndOfRecord();
    }
    spillBuffer.putInt(100);
    assertEquals(spillBuffer.getMarkofLastRecord(), 400);
    assertEquals(spillBuffer.remaining(), (512 - 404));
    spillBuffer.flip();
    assertEquals(spillBuffer.remaining(), 404);
    assertEquals(spillBuffer.getMarkofLastRecord(), 400);

  }
View Full Code Here

Examples of org.apache.lucene.util.FixedBitSet.flip()

    final int n = atLeast(10000);
    final FixedBitSet bits = new FixedBitSet(n);
    Random random = random();
    for (int i = 0; i < n; i++) {
      int idx = random.nextInt(n);
      bits.flip(idx, idx + 1);
    }
   
    FixedBitSet verify = bits.clone();

    ScoredDocIDs scoredDocIDs = ScoredDocIdsUtils.createScoredDocIds(bits, n);
View Full Code Here
TOP
Copyright © 2015 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.