Package com.slytechs.utils.memory

Examples of com.slytechs.utils.memory.BitBuffer


   * (non-Javadoc)
   *
   * @see org.jnetstream.packet.Packet#getBuffer()
   */
  public BitBuffer getBuffer() throws IOException {
    final BitBuffer buffer = getRecordBitBuffer();
    buffer.position(buffer.position() + PcapPacketRecord.HEADER_LENGTH * 8);

    return buffer;
  }
View Full Code Here


   * point at the packet data portion of the buffer referenced as a view.
   *
   * @see com.slytechs.packet.AbstractPacket#getBuffer()
   */
  public BitBuffer getBuffer() throws IOException {
    final BitBuffer b = handle.getBitBuffer();

    if (bits != b) {
      b.position(b.position() + getRecordHeaderLength());
      bits = BitBuffer.wrap(b.toByteBuffer());
    }

    return bits;
  }
View Full Code Here

  public BitBuffer getRecordBitBuffer() throws IOException {
    if (bits != null) {
      return bits;
    }

    final BitBuffer b = this.handle.getBitBuffer();
    this.offset = b.position();

    return b;
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.jnetstream.packet.Packet#getBuffer()
   */
  public BitBuffer getBuffer() throws IOException {
    final BitBuffer b = getRecordBitBuffer();
    b.position(b.position() + SnoopPacketRecord.HEADER_LENGTH * 8);

    return b;
  }
View Full Code Here

    if (headers.isEmpty()) {
      return getBuffer();
    }

    BitBuffer b = getBuffer();

    Header last = headers.getHeader(headers.size() - 1);
    int p = b.position() + last.getOffset() + last.getLength();
    p = (p > b.limit() ? b.limit() : p);

    // Now position the buffer
    b.position(p);

    return b;
  }
View Full Code Here

TOP

Related Classes of com.slytechs.utils.memory.BitBuffer

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.