Feedback
Add binary-safe HTTP responses with MemoryBlock
- Status
- Fixed
- Fixed in
- v26.5.8
- Source discussion
- -
- Last updated
- 2026-06-01
Public summary
Objo now has an explicit byte/text boundary for HTTP and file I/O. A new MemoryBlock type carries raw bytes, while String remains Unicode text. HTTPResponse.Content now returns raw response bytes as a MemoryBlock, and text responses are decoded through HTTPResponse.Text().
This fixes binary downloads such as PNG responses being corrupted when they were previously routed through string APIs. Users can save response bodies directly with HTTPResponse.SaveContent(file) or write bytes through BinaryStream.WriteBytes(resp.Content).
The feature also adds byte-capable helpers across the standard library:
MemoryBlockconstructors, indexing, copy/slice, text/hex/base64 conversion helpers.BinaryStream.ReadBytes,ReadAllBytes,WriteBytes, and async byte variants.FileSystemItem.ReadAllBytes,WriteAllBytes, andAppendBytes.URLConnection.SetRequestContent(content As MemoryBlock, mimeType As String).MultipartFormData.AddFile(... content As MemoryBlock ...).Crypto.RandomBytesRaw(count)returnsMemoryBlock, andCrypto.SecureEqualssupportsMemoryBlockcomparisons.