Examples of position()


Examples of com.alibaba.dubbo.common.io.UnsafeByteArrayInputStream.position()

                is.read(header, length, readable - length);
            }
            for (int i = 1; i < header.length - 1; i ++) {
                if (header[i] == MAGIC_HIGH && header[i + 1] == MAGIC_LOW) {
                    UnsafeByteArrayInputStream bis = ((UnsafeByteArrayInputStream) is);
                    bis.position(bis.position() - header.length + i);
                    header = Bytes.copyOf(header, i);
                    break;
                }
            }
            return super.decode(channel, is, readable, header);
View Full Code Here

Examples of com.collective2.signalEntry.adapter.dynamicSimulator.portfolio.Portfolio.position()

        expectedCash = expectedCash.subtract(expectedBuy.multiply(new BigDecimal(quantity))).subtract(commission);

        assertTrue(processed);
        assertEquals("buy ",expectedBuy, buyProcessor.transactionPrice());
        assertEquals(expectedCash,portfolio.cash());
        assertEquals(Integer.valueOf(0),portfolio.position("GG").quantity());
        assertEquals(new BigDecimal("0"),portfolio.equity(dataProvider));

    }

}
View Full Code Here

Examples of com.esotericsoftware.kryo.io.Input.position()

    }

    @Override
    public Object readClassAndObject(ReadBuffer buffer) {
        Input i = buffer.asRelative(INPUT_FACTORY);
        int startPos = i.position();
        Object value = getKryo().readClassAndObject(i);
        buffer.movePosition(i.position()-startPos);
        return value;
    }
View Full Code Here

Examples of com.esotericsoftware.kryo.io.Output.position()

    });

    Output output = new Output(512, -1);
    kryo.writeObject(output, stuff);

    Input input = new Input(output.getBuffer(), 0, output.position());
    Stuff stuff2 = kryo.readObject(input, Stuff.class);

    assertEquals(stuff.ordering.order, stuff2.ordering.order);
    assertEquals(stuff.get("key"), stuff2.get("key"));
    assertEquals(stuff.get("something"), stuff2.get("something"));
View Full Code Here

Examples of com.google.code.hs4j.network.buffer.IoBuffer.position()

  public void testEncodeDecode() {
    assertNull(this.cmd.getIoBuffer());
    this.cmd.encode();
    IoBuffer buf = this.cmd.getIoBuffer();
    assertNotNull(buf);
    assertEquals(0, buf.position());
    assertTrue(buf.limit() > 0);

    assertEquals("P\t1\tmytest\tuser\tINDEX_1\tid,name,password\n",
        new String(buf.array(), 0, buf.limit()));
View Full Code Here

Examples of com.google.code.yanf4j.buffer.IoBuffer.position()

        // UTF-16: We specify byte order to omit BOM.
        encoder = Charset.forName("UTF-16BE").newEncoder();
        buf.clear();

        buf.putString("ABC", encoder);
        assertEquals(6, buf.position());
        buf.clear();

        assertEquals(0, buf.get(0));
        assertEquals('A', buf.get(1));
        assertEquals(0, buf.get(2));
View Full Code Here

Examples of com.hazelcast.nio.BufferObjectDataInput.position()

            }
            try {
                final byte[] data = datagramPacketReceive.getData();
                final int offset = datagramPacketReceive.getOffset();
                final BufferObjectDataInput input = node.getSerializationService().createObjectDataInput(data);
                input.position(offset);

                final byte packetVersion = input.readByte();
                if (packetVersion != Packet.VERSION) {
                    logger.warning("Received a JoinRequest with a different packet version! This -> "
                            + Packet.VERSION + ", Incoming -> " + packetVersion
View Full Code Here

Examples of com.hazelcast.nio.DynamicByteBuffer.position()

            byte[] header = data.getHeader();
            PortableDataOutput output = (PortableDataOutput) out;
            DynamicByteBuffer headerBuffer = output.getHeaderBuffer();
            out.writeInt(header.length);
            out.writeInt(headerBuffer.position());
            headerBuffer.put(header);
        }
    }

    protected void writeDataInternal(ObjectDataOutput out, Data data) throws IOException {
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.Excerpt.position()

        }
        excerpt.index(-1);
        int count = 0;
        while (excerpt.nextIndex()) {
            int length = (int) excerpt.readStopBit();
            String fix = ChronicleTools.asString(excerpt, excerpt.position(), length);
            assertTrue(fix.startsWith("8=FIX"));
            assertTrue(fix.endsWith(".")); // ^A is replaced with .
            assertEquals(8, fix.length() - fix.lastIndexOf(".10="));
            int pos = -1;
            while ((pos = fix.indexOf(".10=", pos + 1)) > 0)
View Full Code Here

Examples of com.leapmotion.leap.KeyTapGesture.position()

            + ", position: " + screenTap.position() + ", direction: " + screenTap.direction());
        break;
      case TYPE_KEY_TAP:
        KeyTapGesture keyTap = new KeyTapGesture(gesture);
        System.out.println("Key Tap id: " + keyTap.id() + ", " + keyTap.state() + ", position: "
            + keyTap.position() + ", direction: " + keyTap.direction());
        break;
      default:
        System.out.println("Unknown gesture type.");
        break;
    }
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.