Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

LUtilsOutputStream reference

Lexize edited this page Sep 9, 2022 · 1 revision

LUtilsOutputStream

LUtils class that represents output stream.


write(Integer i)
Writes byte into stream.
Input value should be in range from 0 to 255.

close()
Closes stream and writing all data in stream into file.


How to use:

local file = lutils.file;

file:init("test_avatar_folder");

local bArr = lutils.misc.stringToBytes("bar");

local output_stream = file:openWriteStream("foo.txt");

for _, v in ipairs(bArr) do
  output_stream:write(v);
end

output_stream:close();