src/org/jnetpcap/packet/PcapPacket.java
public int transferStateAndDataFrom(JBuffer buffer) {
		final int len = buffer.size();
		JBuffer b = getMemoryBuffer(len);

		buffer.transferTo(b);

		return peerStateAndData(b, 0);
	}
/**
	 * Copies contents of the buffer to new packet. All of the contents of the
	 * buffer are deep copied to new packet. The new packet allocates new memory
	 * for the packet contents, state and header if existing memory buffer is not
	 * large enough. Otherwise the existing memory buffer is overriden and reused.
	 * Existing buffers are not cleared before hand and may contain old data
	 * outside of the new header, state and packet data areas that are being
	 * overriden.
	 * <p>
	 * Supplied buffer layout expected:
	 * 
	 * <pre>
	 * +----------+-----+----+
	 * |PcapHeader|State|Data|
	 * +----------+-----+----+
	 * </pre>
	 * 
	 * </p>
	 * 
	 * @param buffer
	 *          buffer containing capture header, packet state and data buffer
	 *          sequentially in the buffer
	 * @return number of bytes copied
	 */
Copies contents of the buffer to new packet. All of the contents of the
buffer are deep copied to new packet. The new packet allocates new memory
for the packet contents, state and header if existing memory buffer is not
large enough. Otherwise the existing memory buffer is overriden and reused.
Existing buffers are not cleared before hand and may contain old data
outside of the new header, state and packet data areas that are being
overriden.

Supplied buffer layout expected.





@param buffer
buffer containing capture header, packet state and data buffer
sequentially in the buffer
@return number of bytes copied
Copies contents of the buffer to new packet . All of the contents of the buffer are deep copied to new packet . The new packet allocates new memory for the packet contents state and header if existing memory buffer is not large enough . Otherwise the existing memory buffer is overriden and reused . Existing buffers are not cleared before hand and may contain old data outside of the new header state and packet data areas that are being overriden . Supplied buffer layout expected . @param buffer buffer containing capture header packet state and data buffer 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);
	}
public int transferStateAndDataFrom ( JBuffer buffer ) { final int len = buffer . size ( ) ; JBuffer b = getMemoryBuffer ( len ) ; buffer . transferTo ( b ) ; return peerStateAndData ( b , 0 ) ; }
Copies contents of the buffer to new packet.
Copies contents of the buffer to new packet .