public static readPrefix(filename as String, maxBytes as Int) as String throws IOException:
Reads at most the first maxBytes bytes from a text file.
This helper is intended for bounded previews and tooling. It avoids loading large files entirely before truncation.
| Parameter | Description |
|---|---|
filename | File to read from. |
maxBytes | Maximum number of bytes to read. |
Prefix text, trimmed to a valid UTF-8 boundary when possible.