In-memory binary data terms



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5


Binary data terms (or "blobs")

Sometimes you may need to hold some arbitrary raw, opaque data in memory. The data cannot be directly interpreted (at least not easily), and might contain any sequence of bytes. Such an in-memory block is sometimes called a "blob". The more formal name is a binary data term.

A binary data term is therefore just a block of memory with arbitrary data. Often it is just an in-memory copy of a binary file. This can be useful when your code makes many individual reads from different locations in the file, since it avoids repeated file-open and file-close operations, and accesses everything in memory. Sometimes the in-memory image is a portion of a binary file.

Creating a binary data term in memory

The following are ways in which a binary data term can be created.

Note that functions that read or write to external sources (files) require Analytica Enterprise or better.

Reading the contents of an in-memory binary data term

Generally when you are reading a piece of information from the blob, you'll want to interpret the contents in some way. The parameters of GetFromBinaryData enable you to control this interpretation so that you can read as different non-opaque data types.

Conversions

For conciseness, the table says "blob" for in-memory binary data term.

! From To Method Required release
Binary file (or part of) blob ReadBinaryFile Analytica 6.2
blob (or part of) Binary file WriteBinaryFile Analytica 6.2
Part of blob another blob GetFromBinaryData(...typeFlags:7) Analytica 6.2
Image file blob ReadBinaryFile(filename,typeFlags:7) Analytica 6.4
In-memory image blob WriteImageFile("<>", image) Analytica 6.4
image file WriteBinaryFile(...,typeflags:7)

The binary data must contain the bytes for a valid image. || Analytica 6.2

blob in-memory image GetFromBinaryData( ..., typeFlags:8 ) Analytica 6.4
base64 literal blob base64'.... Analytica 6.2
base64 text blob Evaluate( f"base64'{txt}'") | Analytica 6.2
base64 literal image GetFromBinaryData( base64'...', typeFlags:8 ) Analytica 6.4
base64 text image GetFromBinaryData( f"base64'{txt}'", typeFlags:8 ) Analytica 6.4
blob base64 literal text f"{data:b}" Analytica 6.2
hexadecimal literal blob base16'.... Analytica 6.4
hexadecimal text blob Evaluate( f"base16'{txt}'") | Analytica 6.4
hexadecimal literal image GetFromBinaryData( base16'...', typeFlags:8 ) Analytica 6.4
hexadecimal text image ImageFromHex( text ) Analytica 5.0
blob hexadecimal literal text f"{data:X}" Analytica 6.4
blob hexadecimal text (digits only) f"{data:H}" Analytica 6.4

See Also

Comments


You are not allowed to post comments.