Core runtime library providing primitive types (Bool, Byte, Char, Int, Float, String), base collections, and system utilities. Every Objeck program links against this bundle automatically via lang.obl.
Byte
The byte class represents a 1-byte value.
Operations
- Abs
- CRC32
- Clamp
- Clear
- Compare
- CompressBr
- CompressGzip
- CompressZlib
- Error
- ErrorLine
- Find
- FindAll
- IsNeg
- Max
- Min
- PrintLine
- ToBinaryString
- ToChar
- ToFloat
- ToHexString
- ToInt
- ToString
- ToUnicode
- UncompressBr
- UncompressGzip
- UncompressZlib
Abs # function
Returns the absolute value
function : Abs() ~ ByteReturn
| Type | Description |
|---|---|
| Byte | absolute value |
CRC32 # function
Calculates the signed CRC32 value for the stream
function : CRC32() ~ IntReturn
| Type | Description |
|---|---|
| Int | signed CRC32 |
Clamp # function
Returns a given value between an upper and lower bound
function : Clamp(min:Byte, value:Byte, max:Byte) ~ ByteParameters
| Name | Type | Description |
|---|---|---|
| min | Byte | minimal value |
| value | Byte | value between the min and max |
| max | Byte | maximum value |
Return
| Type | Description |
|---|---|
| Byte | min if vaule is less than main, max if max is less than value, otherwise the value |
Clear # function
Set all array elements to zero
function : Clear(b:Byte[]) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| b | Byte | byte array |
Compare # native
Compares two values
function : native : Compare(l:Byte, r:Byte) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| l | Byte | left compare object |
| r | Byte | right compare object |
Return
| Type | Description |
|---|---|
| Int | 0 if equal, -1 if types differ, 1 if equal |
CompressBr # function
Compresses a byte stream using Brotli
function : CompressBr() ~ Byte[]Return
| Type | Description |
|---|---|
| Byte | compressed bytes |
CompressGzip # function
Compresses a byte stream using gzip
function : CompressGzip() ~ Byte[]Return
| Type | Description |
|---|---|
| Byte | compressed bytes |
CompressZlib # function
Compresses a byte stream using zlib
function : CompressZlib() ~ Byte[]Return
| Type | Description |
|---|---|
| Byte | compressed bytes |
Find # native
Searches for the first occurrence of a byte
function : native : Find(bytes:Byte[], search:Byte) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| bytes | Byte | byte array to search |
| search | Byte | byte to search for |
Return
| Type | Description |
|---|---|
| Int | true of found, false otherwise |
Find # native
Searches for the first occurrence of a byte
function : native : Find(bytes:Byte[], offset:Int, search:Byte) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| bytes | Byte | byte array to search |
| offset | Int | search offset |
| search | Byte | byte to search for |
Return
| Type | Description |
|---|---|
| Int | true of found, false otherwise |
Find # native
Searches for the first occurrence of a byte array
function : native : Find(bytes:Byte[], search:Byte[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| bytes | Byte | byte array to search |
| search | Byte | byte array to search for |
Return
| Type | Description |
|---|---|
| Int | index of first occurrence, -1 otherwise |
Find # native
Searches for the first occurrence of a byte array
function : native : Find(bytes:Byte[], offset:Int, search:Byte[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| bytes | Byte | byte array to search |
| offset | Int | search offset |
| search | Byte | byte array to search for |
Return
| Type | Description |
|---|---|
| Int | index of first occurrence, -1 otherwise |
FindAll # function
Searches for all occurrences of the byte array
function : FindAll(bytes:Byte[], search:Byte[]) ~ Int[]Parameters
| Name | Type | Description |
|---|---|---|
| bytes | Byte | byte array to search |
| search | Byte | byte array to search for |
Return
| Type | Description |
|---|---|
| Int | an array of indexes |
IsNeg # function
Checks is a number is negative
function : IsNeg() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if negative, false otherwise |
Max # function
Returns the largest byte value
function : Max(l:Byte, r:Byte) ~ ByteParameters
| Name | Type | Description |
|---|---|---|
| l | Byte | value to compare |
| r | Byte | value to compare |
Return
| Type | Description |
|---|---|
| Byte | largest byte value |
Min # function
Returns the smallest byte value
function : Min(l:Byte, r:Byte) ~ ByteParameters
| Name | Type | Description |
|---|---|---|
| l | Byte | value to compare |
| r | Byte | value to compare |
Return
| Type | Description |
|---|---|
| Byte | smallest byte value |
PrintLine # native
Prints values
function : native : PrintLine(v:Byte[]) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| v | Byte | values to print |
PrintLine # native
Prints values
function : native : PrintLine(v:Byte[,]) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| v | Byte | values to print |
ToBinaryString # native
Returns a binary string representation of the value
function : native : ToBinaryString() ~ StringReturn
| Type | Description |
|---|---|
| String | binary string representation of the value |
ToChar # function
Returns the Character value
function : ToChar() ~ CharReturn
| Type | Description |
|---|---|
| Char | value |
ToFloat # function
Returns the Float value
function : ToFloat() ~ FloatReturn
| Type | Description |
|---|---|
| Float | value |
ToHexString # native
Returns a positive hexadecimal string representation of the value
function : native : ToHexString() ~ StringReturn
| Type | Description |
|---|---|
| String | hexadecimal string representation of the value |
ToString # native
Returns a string representation of the value
function : native : ToString() ~ StringReturn
| Type | Description |
|---|---|
| String | string representation of the value |
ToString # native
Returns a string representation of the byte array
function : native : ToString(v:Byte[]) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| v | Byte | byte array |
Return
| Type | Description |
|---|---|
| String | string representation of the byte array |
ToString # function
Returns a string representation of the byte array
function : ToString(v:Byte[,]) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| v | Byte | byte array |
Return
| Type | Description |
|---|---|
| String | string representation of the byte array |
ToUnicode # function
Converts the byte array to a character array
function : ToUnicode(b:Byte[]) ~ Char[]Parameters
| Name | Type | Description |
|---|---|---|
| b | Byte | array |
Return
| Type | Description |
|---|---|
| Char | character array |
UncompressBr # function
Uncompresses a byte stream using Brotli
function : UncompressBr() ~ Byte[]Return
| Type | Description |
|---|---|
| Byte | uncompressed bytes |