Browse docspacket.read
On this page
API method

packet.read

Reads a typed value from the payload: "u8" "i8" "u16" "i16" "u32" "i32" "f32" "f64", little-endian, with a "be" suffix for big-endian ("u16be").

Syntax

Atlas Script
packet.read(type, offset)

Parameters

type
Numeric value type: "u8", "i8", "u16", "i16", "u32", "i32", "f32", or "f64", with an optional "be" suffix for big-endian.
offset
Byte offset into the packet. Payload-relative for packet.* methods, and absolute (whole IP packet) for the raw_* variants.

Return value

See the remarks for the returned value and runtime behavior.

Remarks

Reads a typed value from the payload: "u8" "i8" "u16" "i16" "u32" "i32" "f32" "f64", little-endian, with a "be" suffix for big-endian ("u16be"). Returns null for an unknown type or when the value would run past the end of the packet.

Examples

Usage pattern
// Replace type, offset with values described above.
packet.read(type, offset);
Reference details are generated from the Atlas Script schema in this documentation source snapshot. Confirm release-specific behavior in the Atlas for Windows build you use.