Lasso Soft Inc. > Home

[ Bytes ]

Method

[Bytes] creates a byte stream that can be used to work with binary data or to convert strings from one character set to another. The [Bytes] method can be used to instantiate a new bytes object, or it can be used to cast string data types as bytes types. Only string data types may be cast as bytes data types.

In the first form the method accepts two optional parameters. The first parameter is a string to be imported into the byte stream. The second parameter defines what character set the string is transformed into before it is imported (e.g. iso-8859-1). If no character set is specified then the string is imported as UTF-8.

In the second form the method accepts two optional parameters. The first specifies the size of the memory buffer in bytes that should be allocated to hold the byte stream. The second specifies the number of bytes that should be added if the initial memory buffer is too small to hold the entire byte stream.

  • Syntax
  • Methods
  • Traits
local(Bytes_Import = Bytes('String Value'))

local(Bytes_ISO_Import = Bytes('String Value', 'iso-8859-1'))

local(Bytes_Preallocate = Bytes(1024))

local(Bytes_Growth = Bytes(1024, 256))
Has methods:
Examples

No examples found

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft