The comparison value that indicates the
end of the reading process. This can be a specific character, number, or
the EOF
symbol.
Optional
opt: Partial<ControllerOptions>Optional configuration.
The property decorator function.
You can use this decorator to read relation or primitive until the EOF.
class BinProtocol {
@Until(EOF)
@Relation(PrimitiveSymbol.u8)
array: number[]
}
This decorator does not accept a function as argument. If you need to use a function to verify an equality based on the currently read value use the While decorator instead.
@Until
decorator reads variable-length array from binary stream until a specified terminating character or magic number is encountered.The main difference between
@Until
and@Count
is that@Until
supports reading data of an undefined length, terminating when a specific character is met. This makes it useful for reading data that ends with a special character or an EOF symbol.