@NullTerminatedString decorator reads a string from a binary stream until
the null-terminator (\0) character is encountered and exclude that
character from the final value.
Type Parameters
This
The type of the class the decorator is applied to.
In the following example, the @NullTerminatedString decorator is used
in conjunction of the @Until decorator to read Null terminated strings
until the end of the file.
This decorator is similar to @Until('\0', { targetType: String }).
The key difference is that @NullTerminatedString always drop the
null-terminator, whereas @Until includes the \0 character as part of
the string.
@NullTerminatedString
decorator reads a string from a binary stream until the null-terminator (\0
) character is encountered and exclude that character from the final value.