Binary module
This module contains low-level functions and data types for handling binary data. These functions may then be used by other modules and programs to handle specific types of binary data (for example, images, compressed files, or strings containing null bytes)
Data types
- Binary::Binary - Block of binary data.
Exceptions
- OffsetOutOfRange - Attempt to access an offset outside a block
Functions
- [Int] array(Binary block) - Return a block as an array.
- Binary base64Decode(String block) - base64 decode a String
- String base64Encode(Binary block) - base64 encode a block
- Ptr blockData(Binary b) - Get a foreign pointer to Binary data
- Int blockSize(Binary b) - Get the size of a block
- Binary copyBlock(Binary block) - Copy a block of data.
- Binary copyChunk(Binary block,Int offset,Int bsize) - Copy a sub-block.
- Binary createBlock(Int bsize) - Create a new, uninitialised block for binary data.
- Binary createInitialisedBlock(Ptr ptr,Int bsize) - Create a new and initialised block for binary data.
- [Int] getBlockChunk(Binary block,Int offset,Int bsize) - Return a chunk from a block as an array.
- Int peek(Binary block,Int offset) - Query binary data.
- String peekString(Binary block,Int offset) - Read a String from binary data.
- Void poke(var Binary block,Int offset,Int val) - Modify binary data.
- Void pokeString(var Binary block,Int offset,String val) - Write a String of binary data.
- Binary readBlock(File h,Int bsize) - Read a block from a file.
- Void setBlockData(var Binary block,Int offset,[Int] bdata) - Set the contents of a block.
- Void writeBlock(File h,Binary block) - Write a block to a file.