Buffers¶
Buffers are raw byte arrays used for handling binary data. They are created using the sys.alloc(size) function.
Creating a Buffer¶
Accessing and Modifying Data¶
Buffers can be accessed and modified using array indexing syntax []. Values must be integers between 0 and 255.
Bounds Checking¶
Accessing indices outside the buffer's range will throw a runtime error. This error can be caught using a try-catch block. If uncaught, it will terminate the program.
Value Validation¶
Assigning values outside the range 0-255 will throw a runtime error. This error can be caught using a try-catch block.