Examples of writeInt()


Examples of one.nio.serial.DataStream.writeInt()

        css.writeObject(request);
        int requestSize = css.count();

        byte[] buffer = new byte[requestSize + 4];
        DataStream ds = css.hasCycles() ? new SerializeStream(buffer) : new DataStream(buffer);
        ds.writeInt(requestSize);
        ds.writeObject(request);
        return buffer;
    }

    private void sendRequest(Socket socket, byte[] buffer) throws IOException {
View Full Code Here

Examples of org.activeio.PacketData.writeInt()

        return logFileOffset;
    }
   
    public void writeToPacket(Packet packet) throws IOException {
        PacketData data = new PacketData(packet);
        data.writeInt(logFileId);
        data.writeInt(logFileOffset);
    }

    public void writeToDataOutput(DataOutput data) throws IOException {
        data.writeInt(logFileId);
View Full Code Here

Examples of org.activemq.message.ActiveMQBytesMessage.writeInt()

    }
  }
  public void testReadInt() {
    ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
    try {
      msg.writeInt(3000);
      msg.reset();
      assertTrue(msg.readInt() == 3000);
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
      assertTrue(false);
View Full Code Here

Examples of org.activemq.message.ActiveMQStreamMessage.writeInt()

      msg.reset();
      assertTrue(((Short)msg.readObject()).shortValue()==testShort);
      msg.clearBody();
     
      int testInt = 4;
      msg.writeInt(testInt);
      msg.reset();
      assertTrue(((Integer)msg.readObject()).intValue()==testInt);
      msg.clearBody();
     
      long testLong = 6l;
View Full Code Here

Examples of org.apache.accumulo.core.file.blockfile.ABlockWriter.writeInt()

     
      closeData();
     
      ABlockWriter mba = fileWriter.prepareMetaBlock("RFile.index");
     
      mba.writeInt(RINDEX_MAGIC);
      mba.writeInt(RINDEX_VER_7);
     
      if (currentLocalityGroup != null)
        localityGroups.add(currentLocalityGroup);
     
View Full Code Here

Examples of org.apache.activeio.packet.PacketData.writeInt()

        return logFileOffset;
    }
   
    public void writeToPacket(Packet packet) throws IOException {
        PacketData data = new PacketData(packet);
        data.writeInt(logFileId);
        data.writeInt(logFileOffset);
    }

    public void writeToDataOutput(DataOutput data) throws IOException {
        data.writeInt(logFileId);
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQBytesMessage.writeInt()

    }

    public void testReadInt() {
        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
        try {
            msg.writeInt(3000);
            msg.reset();
            assertTrue(msg.readInt() == 3000);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQStreamMessage.writeInt()

    public void testReadInt() {
        ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
        try {
            int test = 4;
            msg.writeInt(test);
            msg.reset();
            assertTrue(msg.readInt() == test);
            msg.reset();
            assertTrue(msg.readLong() == test);
            msg.reset();
View Full Code Here

Examples of org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream.writeInt()

                ByteSequence sequence = buff.toByteSequence();
               
                // Now we can fill in the batch control record properly.
                buff.reset();
                buff.skip(5+Journal.BATCH_CONTROL_RECORD_MAGIC.length);
                buff.writeInt(sequence.getLength()-Journal.BATCH_CONTROL_RECORD_SIZE);
                if( journal.isChecksum() ) {
                  Checksum checksum = new Adler32();
                  checksum.update(sequence.getData(), sequence.getOffset()+Journal.BATCH_CONTROL_RECORD_SIZE, sequence.getLength()-Journal.BATCH_CONTROL_RECORD_SIZE);
                  buff.writeLong(checksum.getValue());
                }
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayOutputStream.writeInt()

                } else {

                    // Combine the smaller writes into 1 big buffer
                    while (write != null) {

                        buff.writeInt(write.location.getSize());
                        buff.writeByte(write.location.getType());
                        buff.write(RESERVED_SPACE);
                        buff.write(AsyncDataManager.ITEM_HEAD_SOR);
                        buff.write(write.data.getData(), write.data.getOffset(), write.data.getLength());
                        buff.write(AsyncDataManager.ITEM_HEAD_EOR);
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.