Examples of JBuffer


Examples of org.jnetpcap.nio.JBuffer

   *          sequentially in the buffer
   * @return number of bytes copied
   */
  public int transferStateAndDataFrom(byte[] buffer) {

    JBuffer b = getMemoryBuffer(buffer);

    return peerStateAndData(b, 0);
  }
View Full Code Here

Examples of org.jnetpcap.nio.JBuffer

   *          start of pcap header.
   * @return number of bytes copied
   */
  public int transferStateAndDataFrom(ByteBuffer buffer) {
    final int len = buffer.limit() - buffer.position();
    JBuffer b = getMemoryBuffer(len);

    b.transferFrom(buffer, 0);

    return peerStateAndData(b, 0);
  }
View Full Code Here

Examples of org.jnetpcap.nio.JBuffer

   *          sequentially in the buffer
   * @return number of bytes copied
   */
  public int transferStateAndDataFrom(JBuffer buffer) {
    final int len = buffer.size();
    JBuffer b = getMemoryBuffer(len);

    buffer.transferTo(b);

    return peerStateAndData(b, 0);
  }
View Full Code Here

Examples of org.jnetpcap.nio.JBuffer

   * @param packet
   *          destination packet to which to copy header, state and packet data
   * @return number of bytes copied
   */
  public int transferStateAndDataTo(PcapPacket packet) {
    JBuffer buffer = packet.getMemoryBuffer(this.getTotalSize());

    int o = header.transferTo(buffer, 0);
    packet.header.peerTo(buffer, 0);

    packet.state.peerTo(buffer, o, state.size());
View Full Code Here

Examples of org.jnetpcap.nio.JBuffer

    private Class<? extends JHeader> _clazz;

    public JPcapPacket(byte[] data, Class<? extends JHeader> clazz) {
        super(POINTER);
        PcapHeader pcapHeader = new PcapHeader();
        super.transferHeaderAndDataFrom(pcapHeader, new JBuffer(data));
//    super.getDefaultScanner().scan(this, Ethernet.ID);
        this._clazz = clazz;
    }
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.