→ index of namespace default
 
→ index of project core
 
→ index of module core

Class core.Buffer


Synopsis: An array of bytes.

  Base classes:
  Methods:

Method base64Decode
Base64-decode String to buffer. Set io_offset to decoded size.
Signature
base64Decode():String in:int
Returns
String in:int–Number of decoded chars (excluding ASCIIZ)

 
→ top of page
Method base64Encode
Base64-encode buffer region 0..io_offset and write to out String.
Signature
base64Encode():String out:int
Returns
String out:int–Number of encoded chars (excluding ASCIIZ)

 
→ top of page
Method compareBuffer
Compare buffer to other buffer (io_offset bytes).
Signature
compareBuffer():Buffer o:boolean
Returns
Buffer o:boolean–true when bytes match, false otherwise

 
→ top of page
Method fillI8
Fill the entire buffer with byte 'c'.
Signature
fillI8()

 
→ top of page
Method fillZero
Fill the entire buffer with 0.
Signature
fillZero()

 
→ top of page
Method free
Free buffer bytes
Signature
free()

 
→ top of page
Method getChecksum
Return checksum for this Buffer.
Signature
getChecksum():int
Returns
int–32bit buffer checksum

 
→ top of page
Method getString
Extract 0 terminated string from buffer.
Signature
getString(intoff,
  intmax 
  )  
 :String
Arguments
intoff–Buffer offset
intmax–Maximum number of characters to extract
Returns
String–new String instance holding the extracted string
Description

At most "max" characters will be extracted.

 
→ top of page
Method gunzip
Uncompress the given source buffer.
Signature
gunzip(Buffersrc,
  intoff,
  intlen,
  intuncompressedSize 
  )  
Arguments
Buffersrc–Which buffer to uncompress
intoff–Source buffer offset
intlen–Compressed size
intuncompressedSize–(maximum) Uncompressed size
Description

This buffer will be resized to the uncompressed size.

 
→ top of page
Method gzip
Compress the given source buffer.
Signature
gzip(Buffersrc,
  intoff,
  intlen,
  intlevel 
  )  
 :boolean
Arguments
Buffersrc–Which buffer to compress
intoff–Source offset
intlen–Number of bytes to compress
intlevel–Compression level (0..9)
Returns
boolean–true if the given buffer has been compressed successfully, false otherwise.
Description

This buffer will be resized to the compressed size.

 
→ top of page
Method hexdump
Debug-print buffer(area) to console.
Signature
hexdump(intnum)
 :int start
Arguments
intnum–
Returns
int start–

 
→ top of page
Method peekF32
Read 32bit single precision floating point value from the given buffer offset.
Signature
peekF32(intoff)
 :float
Arguments
intoff–Where to read the 32bit floating point value from
Returns
float–32bit single precision floating point value

 
→ top of page
Method peekI14
Read short 7:7 integer from the given buffer offset.
Signature
peekI14(intoff)
 :short
Arguments
intoff–Where to read the short integer from
Returns
short–Short integer
Description

The return value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method peekI16
Read unsigned short integer from the given buffer offset.
Signature
peekI16(intoff)
 :short
Arguments
intoff–Where to read the short integer from
Returns
short–Short integer
Description

The return value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method peekI32
Read unsigned 32bit integer from the given buffer offset.
Signature
peekI32(intoff)
 :int
Arguments
intoff–Where to read the 32bit integer from
Returns
int–32bit integer
Description

The return value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method peekI8
Read unsigned byte from the given buffer offset
Signature
peekI8(intoff)
 :byte
Arguments
intoff–Where to read the byte from
Returns
byte–Byte

 
→ top of page
Method peekS16
Read signed short integer from the given buffer offset.
Signature
peekS16(intoff)
 :short
Arguments
intoff–Where to read the short integer from
Returns
short–Short integer
Description

The return value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method peekS32
Read signed 32bit integer from the given buffer offset.
Signature
peekS32(intoff)
 :int
Arguments
intoff–Where to read the 32bit integer from
Returns
int–32bit integer
Description

The return value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method peekS8
Read signed byte from the given buffer offset
Signature
peekS8(intoff)
 :byte
Arguments
intoff–Where to read the byte from
Returns
byte–Byte

 
→ top of page
Method pokeF32
Store 32bit single precision floating point value at the given buffer offset.
Signature
pokeF32(intoff,
  floatvalue 
  )  
Arguments
intoff–Where to store the floating point value
floatvalue–Which floating point value to store

 
→ top of page
Method pokeI14
Store short 7:7 integer at the given buffer offset.
Signature
pokeI14(intoff,
  shortvalue 
  )  
Arguments
intoff–Where to store the short
shortvalue–Which short to store
Description

The value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method pokeI16
Store short integer at the given buffer offset.
Signature
pokeI16(intoff,
  shortvalue 
  )  
Arguments
intoff–Where to store the short
shortvalue–Which short to store
Description

The value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method pokeI32
Store 32bit integer at the given buffer offset.
Signature
pokeI32(intoff,
  intvalue 
  )  
Arguments
intoff–Where to store the 32bit integer
intvalue–Which 32bit integer to store
Description

The value byteorder will be swapped according to the current buffer byteorder.

 
→ top of page
Method pokeI8
Store byte at the given buffer offset
Signature
pokeI8(intoff,
  bytevalue 
  )  
Arguments
intoff–Where to storethe byte
bytevalue–Which byte to store

 
→ top of page
Method readBufferBits
Treat buffer as bitstream and read up to 32 bits from the given start bit offset.
Signature
readBufferBits(intnumBits)
 :int
Arguments
intnumBits–Number of bits (up to 32)
Returns
int–Value

 
→ top of page
Method resize
Change the size of the buffer.
Signature
resize(intnum)
 :boolean
Arguments
intnum–New buffer size
Returns
boolean–true if the reallocation succeeded, false otherwise

 
→ top of page
Method ringReadBuffer
Copy ringbuffer area within this buffer to dst buffer.
Signature
ringReadBuffer(intringStartOff,
  intringSz,
  Bufferdst,
  intdstOff,
  intnumBytes 
  )  
Arguments
intringStartOff–Start of ringbuffer area
intringSz–Ringbuffer size
Bufferdst–
intdstOff–Write offset
intnumBytes–Number of bytes

 
→ top of page
Method ringWriteBuffer
Copy buffer data to ringbuffer area within this buffer.
Signature
ringWriteBuffer(intringStartOff,
  intringSz,
  Buffersrc,
  intsrcOff,
  intnumBytes 
  )  
Arguments
intringStartOff–Start of ringbuffer area
intringSz–Ringbuffer size
Buffersrc–Source buffer
intsrcOff–Read offset
intnumBytes–Number of bytes

 
→ top of page
Method setSize
Allocate the given number of bytes.
Signature
setSize(intnum)
 :boolean
Arguments
intnum–New buffer size
Returns
boolean–true if the allocation succeeded, false otherwise

 
→ top of page
Method setString
Store 0 terminated string at the given buffer offset.
Signature
setString(intoff,
  Strings 
  )  
 :boolean
Arguments
intoff–Where to store the string
Strings–Which string to store
Returns
boolean–true if the string has been stored successfully, false otherwise

 
→ top of page
Method substring
Extract 0 terminated string from buffer.
Signature
substring(Stringr,
  intoff,
  intmax 
  )  
Arguments
Stringr–Receives the extracted string
intoff–Buffer offset
intmax–Maximum number of characters to extract
Description

The result will be written to String "r".At most "max" characters will be written.

 
→ top of page
Method truncate
Truncate buffer size (w/o reallocation).
Signature
truncate():int sz
Returns
int sz–
Description

Current size must be >= 'sz'.

 
→ top of page
Method visit
Create view into other buffer.
Signature
visit(intoff,
  intlen 
  )  
 :Buffer b
Arguments
intoff–Source buffer offset
intlen–Area size
Returns
Buffer b–true if the source buffer is allocated and the area is within bounds, false otherwise.
Description

The previous content of this buffer will be freed.
Make sure to keep the source buffer alive as long as the visited data in this buffer is accessed.

 
→ top of page
Method writeBufferBits
Treat buffer as bitstream and write up to 32 bits to the given start bit offset.
Signature
writeBufferBits(intnumBits,
  intval 
  )  
 :int startBit
Arguments
intnumBits–Number of bits (up to 32)
intval–Value to store into buffer
Returns
int startBit–Value

 
→ top of page
 

Project Modules:core 
Project Classes:Boolean , Buffer , Byte , Class , ClassArray , Condition , Configuration , Double , DummyStream , Envelope , Event , Exception , File , Float , FloatArray , FloatArray128 , FloatArray16 , FloatArray32 , FloatArray64 , FloatArray8 , Function , HashTable , IntArray , IntArray128 , IntArray16 , IntArray32 , IntArray64 , IntArray8 , Integer , LFSR , LFSR_NR , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , Process , Script , SharedBuffer , Short , Stack , StdErrStream , StdInStream , StdOutStream , Stream , String , String128 , String16 , String32 , String64 , String8 , StringArray , StringIterator , Thread , Time , TKS , TreeNode , UnsignedByte , UnsignedInteger , UnsignedLong , UnsignedShort , Value , ValueArray , Variable 
Project Functions:ceil , exit , floor , GetCurrentThread , getenv , lcchar , mathAbsMaxf , mathAbsMinf , mathAbsMini , mathAbsMini , mathCerpf , mathClampf , mathClampi , mathDistancePointPlane2d , mathFoldf , mathFoldi , mathGCD , mathLerpCyclicf , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathNextCyclicf , mathPowerf , mathPowerfC , mathPoweri , mathSerpf , mathSmoothStepf , mathSmoothStepNf , mathWrapf , mathWrapi , milliSeconds , milliSecondsDouble , psystem , putenv , srand , system , ucchar 
All Namespaces:default , graph , ui 
All Projects:core , eqxmms , ShaderVG , ShaderVG_Text , tkanalogrytm , tkchipmunk , tkclap , tkfileutils , tkfreeglut , tkfreetype2 , tkfreeverb , tkmath , tkmidi , tkmidipipe , tkminnie , tkoldmath , tkopengl , tkportaudio , tkradiastools , tksamplechain , tksampleedit , tksampler , tksdl , tksdl_net , tksidplay2 , tkspeexdsp , tksqlite , tktriangulate , tkui , tkvst2 , tkzip , ui , yingtest 


auto-generated by "DOG", the TkScript document generator. Tue, 3/Mar/2026 18:10:17