Package org.apache.activeio.packet

Examples of org.apache.activeio.packet.ByteArrayPacket


      nextAllocationSize = initialSize;
        current = allocate();
    }
   
    protected Packet allocate() {
      ByteArrayPacket packet = new ByteArrayPacket(new byte[nextAllocationSize]);
      nextAllocationSize <<= 3; // x by 8
        return packet;
    }
View Full Code Here


            throw new IllegalArgumentException("The journal does not support message references.");
        }
    }

    public Packet toPacket(ByteSequence sequence) {
        return new ByteArrayPacket(new org.apache.activeio.packet.ByteSequence(sequence.data, sequence.offset, sequence.length));
    }
View Full Code Here

            throw new IllegalArgumentException("The journal does not support message references.");
        }
    }

    public Packet toPacket(ByteSequence sequence) {
        return new ByteArrayPacket(new org.apache.activeio.packet.ByteSequence(sequence.data, sequence.offset, sequence.length));
    }
View Full Code Here

            throw new IllegalArgumentException("The journal does not support message references.");
        }
    }

    public Packet toPacket(ByteSequence sequence) {
        return new ByteArrayPacket(new org.apache.activeio.packet.ByteSequence(sequence.data, sequence.offset, sequence.length));
    }
View Full Code Here

    /**
     * @param string
     * @return
     */
    private Packet createPacket(String string) {
        return new ByteArrayPacket(string.getBytes());
    }
View Full Code Here

  public Packet read(RecordLocation location)
      throws InvalidRecordLocationException, IOException {
     
      try {
            LogRecord record = logger.get(null, toLong(location));
            return new ByteArrayPacket(record.data);           
    } catch (InvalidLogKeyException e) {
      throw new InvalidRecordLocationException(e.getMessage(), e);
    } catch (Exception e) {
      throw (IOException) new IOException("Journal write failed: " + e)
          .initCause(e);
View Full Code Here

TOP

Related Classes of org.apache.activeio.packet.ByteArrayPacket

Copyright © 2018 www.massapicom. 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.