@Target(value=PARAMETER) @Retention(value=RUNTIME) @Documented public @interface MaxBytes
The annotation can be applied to method parameters that accept variable-length data types (e.g. arrays, collections, strings) to enforce constraints on the amount of memory they can use.
This can be particularly useful in scenarios where memory usage needs to be tightly controlled or when interacting with external systems that impose data size limits.
| Modifier and Type | Optional Element and Description |
|---|---|
int |
value
Specifies the maximum number of encoded bytes allowed for the variable-length data type.
|
Copyright © 2024. All rights reserved.