Coveo Knowledge Base – Information Article – 060331-1

BinaryData Object Reference

The information in this technical note applies to:

Coveo Enterprise Search 4

Summary

This document contains complementary information about the BinaryData scripting object.

Definition
Overview
Properties
Methods

Definition

The BinaryData scripting object contains multiple useful properties and methods to manipulate a binary stream.

Overview

This is a list of all BinaryData properties and methods.

·          Properties: BytesCount, CharsCount

·          Methods: LoadFromFile, ReadBinary, ReadByteString, ReadString, SaveToFile, SeekReadPointerInBytes, SeekReadPointerInChars, SeekWritePointerInBytes, SeekWritePointerInChars, TemporaryFileName, WriteAsByteString, WriteBinary, WriteString

Properties

Name

Type

Description

Read-only State

BytesCount

Long

Get the size (in bytes) of the binary stream.

Read-only

CharsCount

Long

Get the size (in wide characters) of the binary stream.

Read-only

Methods

Name

Type

Description

Parameters

LoadFromFile

 

Load a binary stream from a file.

p_FileName (String): The name of the file to load.

ReadBinary

Variant Array

Read an array of bytes from the binary stream.

p_NumBytesToRead (Long): The number of bytes to read.

ReadByteString

String

Read bytes and interpret this as a 8-bit strings.  Returns UNICODE string.

p_NumBytesToRead (Long): The number of bytes to read.

p_InputCharset (Charsets enum): The charset of the stream.

ReadString

String

Read a string from the binary stream.

p_NumCharsToRead (Long): The number of characters to read.

SaveToFile

 

Save a binary stream to a file.

p_FileName (String): The name of the file to save to.

SeekReadPointerInBytes

 

Seeks the read pointer (in bytes) in the binary stream.

p_SeekPosition (Long): The new seek position.

SeekReadPointerInChars

 

Seeks the read pointer (in wide chars) in the binary stream.

p_SeekPosition (Long): The new seek position.

SeekWritePointerInBytes

 

Seeks the write pointer (in bytes) in the binary stream.

p_SeekPosition (Long): The new seek position.

SeekWritePointerInChars

 

Seeks the write pointer (in wide chars) in the binary stream.

p_SeekPosition (Long): The new seek position.

TemporaryFileName

String

Get a temporary file name.

p_ExtensionToGive (String): The temporary file extension.

WriteAsByteString

 

Write a string in the binary stream, converting 2 bytes chars to 1 byte chars.

p_String (String): The string to write.

WriteBinary

 

Write an array of bytes in the binary stream.

p_ArrayOfBytes (Variant): The byte stream to write.

WriteString

 

Write a string in the binary stream.

p_String (String): The string to write.

 

See Conversion Script Objects Reference to get a complete list of all available conversion script objects.