On this page
packet.bytes
Returns payload bytes as an array of numbers.
Syntax
Atlas Script
packet.bytes(offset?, count?)Parameters
offsetOptional- Byte offset into the packet. Payload-relative for packet.* methods, and absolute (whole IP packet) for the raw_* variants.
countOptional- Optional number of bytes to include. Omit it to run to the end of the payload; a larger count is clamped to the bytes available.
Return value
Returns payload bytes as an array of numbers.
Remarks
Returns payload bytes as an array of numbers. With no arguments, returns the whole payload; with only an offset, the bytes from there to the end. count is clamped to the bytes available, and an offset past the end returns an empty array.
Examples
Usage pattern
// Replace offset, count with values described above.
packet.bytes(offset, count);