ByteArray

          Class 
          Member of  ScriptUtils Use ByteArray object 

Description
Works with safearray binary data - save/restore binary data from/to a disk, convert to a string/hexstring, codepage/charset conversions, Base64 conversion, etc.
  • Read and write binary data from a disk.
  • Conversion between unicode string (OLE string - VBA, VBScript, Jscript) and any code page (ConvertCodePages).
  • Conversion from/to any code page (charset). See list of available charsets at ConvertCodePages page and CharSetConvert method.
  • Hi-speed binary-to-hex, hex-to-binary, string-to-hex and hex-to-string conversion algorithm (usable to store binary data with SQL statement, HexString property)
  • Hi-performance Base64 decoder and encoder (binary-to-Base64 encode and decode)

Other features

Methods
Find Returns a Long specifying the position of the first occurrence of the data binary array.
FindRev Returns a Long specifying the position of the first occurrence of the data in binary array from the end of data.
CharSetConvert Converts bytearray (as CharSet/CodePage code page) to another charset/code page.
Left Returns Length bytes from the left of array
Mid Returns data from middle of the array.
ReadFrom Reads data from file.
Right Returns Length bytes from the right of array
SaveAs Saves the ByteArray data as a file.
SetSize Sets a new size of binary data. If old size is greter than new size, data is truncated to the new size.
Properties
Base64 Converts data between ByteArray (safearray of bytes) and Base64. Works as a Base64 encoder and decoder from binary (bytearray) or from Unicode String.
Variant, RW
ByteArray Contens of ByteArray object as byte safearray or one byte from array.
Variant, RW
CodePage Code page for converting between binary and String data.
ConvertCodePages, RW
HexString Returns contents of the ByteArray as hexadecimal string (base16 string)
String, RW
CharSet String representation of a CodePage. This value specifies the code page of a source binary data for binary to unicode String conversion.
String, RW
Length Length of the data.
Long, RW
Punycode Returns unicode String as punycode encoded string. You can directly convert data from/to any charset to punycode using this property.
String, RW
String Returns (or sets) the data as a string. The binary data are converted to/from a unicode string using CodePage.
String, RW
Examples
Used in
  Other links for ByteArray class
ScriptUtilities and Huge ASP file upload classes
      Easy to use, hi-performance ASP file upload component with progress bar indicator. Let's you upload multiple files with size up to 2GB to a disk or database along with another form fields. Works with large posts, any character set (including unicode utf-8). Contains one-click multiple files/folders download with on-the-fly compression (Using BinaryWrite/BinaryRead).
      Hi-performance text file logging for ASP/VBScript/VBA applications. Lets you create daily/weekly/monthly log files with variable number of logged values and extra timing and performance info.
       Lets you work with safearray binary data in VBS/JS. It also enables conversion between binary and String data using several code pages. ZLib compress and uncompress functions. Lets you transfer files using compressed stream from a client to server using IE.
      This library also enables calling of some Kernel and Advapi functions (performance, timing, sleep, configuration ...) and enables native work with INI files.

  Additional notes
     ByteArray is a COM class specially designed to work with Microsoft Windows Scripting engines - VB Script and JScript in Active Server Pages or WSH and in CHM or HTA applications. It also works with VB Net, Visual basic (VBA - VB 5, VB 6, Word, Excel, Access, …), C#, J#, C++, ASP, ASP.Net, Delphi and with T-SQL OLE functions - see Use ByteArray object article. You can also use the object in other programming environments with COM support, such is PowerBuilder.
     Source code for ByteArray is available within distribution license, please see License page for ScriptUtilities and Huge ASP file upload.

© 1996 – 2005 Motobit Software, help{at}pstruh.cz, help v. 2.16.14