FixedString4096Bytes
struct in
Unity.Collections
Implements interfaces:IIndexable<T0>, INativeList<T0>, IUTF8Bytes
Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
The binary layout of this string is guaranteed, for now and all time, to be a length (a little-endian two byte integer)
followed by the bytes of the characters (with no padding). A zero byte always immediately follows the last character.
Effectively, the number of bytes for storing characters is 3 less than 4096 (two length bytes and one null byte).
This layout is identical to a FixedList4096Bytes<T0> of bytes, thus allowing reinterpretation between FixedString4096Bytes and FixedList4096Bytes.
By virtue of being an unmanaged, non-allocated struct with no pointers, this string is fully compatible with jobs and Burst compilation.
Unlike managed string types, these strings can be put in any unmanaged ECS components, FixedList, or any other unmanaged structs.