A specifier part is consist of a speficier, an endian, and a length. An endian and a lengthare optional.
SpecifierPart := Specifier[Endian][Length]
Here is the list of specifiers.
[Specifiers] [Types] [An output binary in packor an input binary in unpack]
a string string. It is null padded in packmethod.
h string A hexstring (low nybble first)
H string A hexstring (high nybble first)
c Byte or byte[] Singed 8-bit integers
C Byte or byte[] Unsinged 8-bit integers
s Short or short[] Singed 16-bit integers
S Short or short[] Unsinged 16-bit integers
l Int or int[] Singed 32-bit integers
L Int or int[] Unsinged 32-bit integers
q Long or long[] Singed 64-bit integers
Q Long or long[] Unsinged 64-bit integers
f Float or float[] 32-bit floating point numbers.
d Double or double[] 64-bit floating point numbers.
An endian is big-endian C<E<gt>> or little-endian C<E<gt>>.
If big-endian is specified, the binary data is converted from big-endian to system-endian in L</"pack"> method, or from system-endian to big-endian in L</"unpack"> method.
If little-endian is specified, the binary data is converted from little-endian to system-endian in L</"pack"> method, or from system-endian to little-endian in L</"unpack"> method.
A lengthmust be a positive integer or a wildcard C<*>. If a lengthor a wildcard is specified, the type(such as C<Int>) becomes a corresponding array type(such as C<int[]>).
Exceptions:
If template syntax is invalid, an exception is thrown.
The template $templatemust be defined. Otherwise an exception is thrown.
The objects $objectsmust be defined. Otherwise an exception is thrown.
The lengthof the specifiers in the template $templatemust be less than or equal to the lenght of the objects $objects. Otherwise an exception is thrown.
The type of the element in the objects $objectsis invalid, an exception is thrown.
Converts the binary data $binaryto the objects $objectsaccording to the template $template, and returns it.
See L</"pack"> method about templates.
Exceptions:
If template syntax is invalid, an exception is thrown.
The template $templatemust be defined. Otherwise an exception is thrown.
The binary data $binarymust be defined. Otherwise an exception is thrown.
The current offset $binary_offsetplus (the size $size* the length$lengthof the specifier) must be less than the length($binary_length) of the binary data $binary. Otherwise an exception is thrown.
=head1 Copyright & License
Copyright (c) 2024 Yuki Kimoto
MIT License
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
go to github issues (only if github is preferred repository)