Showing content from http://reference.wolfram.com/language/ref/compiledtype/ByteArray.html below:
ByteArray—Wolfram Documentation
WOLFRAM Consulting & Solutions
We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technical expertise
- Data & Computational Intelligence
- Model-Based Design
- Algorithm Development
- Wolfram|Alpha for Business
- Blockchain Technology
- Education Technology
- Quantum Computation
WolframConsulting.com
"ByteArray"
represents a one-dimensional array of bytes.
Details
- "ByteArray" can be used in Typed and related constructs to specify a type.
- "ByteArray" objects are automatically memory managed.
Constructors
- ByteArray["string"] constructs a "ByteArray" object by extracting byte values from a Base64-encoded string.
- ByteArray[na] constructs a copy of the array na, where na has the type "NumericArray"::["UnsignedInteger8", 1].
- CreateTypeInstance["ByteArray",len] constructs a byte array of length len.
- CreateTypeInstance["ByteArray",byte,len] constructs a byte array of length len filled with byte values.
Conversions
Expressions
- "ByteArray" objects can be converted to and from ByteArray expressions.
"NumericArray"
- "ByteArray" objects can be converted to and from "NumericArray"::["UnsignedInteger8",1] objects.
Runtime Errors
ArrayPartError
- Operations that require extracting elements from a "ByteArray" can give a runtime error if those elements do not exist.
Cast
- Casting from or to a "ByteArray" object can give a runtime error if the object cannot be converted to the target type.
Examplesopen all close all Basic Examples (2)
"ByteArray" can be used as input or output for a CompiledCodeFunction:
Create a "ByteArray" in compiled code:
Scope (8) Construction (4)
Construct a "ByteArray" from a string:
Construct a "ByteArray" from a numeric array:
Create a "ByteArray" instance of a given length:
Note that the created byte array is filled with random values:
Create a "ByteArray" instance of a given length filled with an initial value:
Properties & Relations (5)
Get the length:
Get the head:
Get an element:
Convert a "ByteArray" to a normal expression:
Convert a "ByteArray" to a string:
Possible Issues (2)
Part access can cause a runtime error if the element does not exist:
Casting can cause a runtime error if the object cannot be converted to the target type:
History
Introduced in 2023 (13.3)
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4