home
 
 index of namespace default
 
 index of project core
 
 index of module core

Class core.Buffer


SynopsisAn array of bytes.

  Base classes:
  Methods:
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
int32bit buffer checksum

 
 top of page
Method getString
Extract 0 terminated string from buffer.
Signature
getString(intoff,
  intmax 
  )  
 :String
Arguments
intoffBuffer offset
intmaxMaximum number of characters to extract
Returns
Stringnew 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
BuffersrcWhich buffer to uncompress
intoffSource buffer offset
intlenCompressed 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
BuffersrcWhich buffer to compress
intoffSource offset
intlenNumber of bytes to compress
intlevelCompression level (0..9)
Returns
booleantrue if the given buffer has been compressed successfully, false otherwise.
Description

This buffer will be resized to the compressed size.

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

 
 top of page
Method peekI16
Read short integer from the given buffer offset.
Signature
peekI16(intoff)
 :short
Arguments
intoffWhere to read the short integer from
Returns
shortShort integer
Description

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

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

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

 
 top of page
Method peekI8
Read byte from the given buffer offset
Signature
peekI8(intoff)
 :byte
Arguments
intoffWhere to read the byte from
Returns
byteByte

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

 
 top of page
Method pokeI16
Store short integer at the given buffer offset.
Signature
pokeI16(intoff,
  shortvalue 
  )  
Arguments
intoffWhere to store the short
shortvalueWhich 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
intoffWhere to store the 32bit integer
intvalueWhich 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
intoffWhere to storethe byte
bytevalueWhich byte to store

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

 
 top of page
Method setSize
Allocate the given number of bytes.
Signature
setSize(intnum)
 :boolean
Arguments
intnumNew buffer size
Returns
booleantrue 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
intoffWhere to store the string
StringsWhich string to store
Returns
booleantrue 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
StringrReceives the extracted string
intoffBuffer offset
intmaxMaximum number of characters to extract
Description

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

 
 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 , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , 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 , mathClampf , mathClampi , mathDistancePointPlane2d , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathPowerf , mathPoweri , mathSmoothStepf , mathWrapf , mathWrapi , milliSeconds , psystem , putenv , srand , system , ucchar 
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54