Buffered file-like stream helpers used by OpenOS and SecureOS I/O wrappers.
- Repository:
opensecurity - System:
secureos - Type:
library
OpenSecurity/src\main\resources\assets\opensecurity\lua\SecureOS\lib\buffer.lua
local buffer = require("buffer")- Description: Flush pending output when needed, mark the wrapper closed, and then close the underlying stream.
buffer.close()- Description: Write the current buffered output block to the underlying stream immediately.
buffer.flush()- Description: Return the current read timeout in seconds used by buffered read helpers.
buffer.getTimeout()- Description: Return an iterator that repeatedly reads records from the buffered stream.
- Parameters:
...
buffer.lines(nil)- Description: Wrap a raw stream handle with buffering, read timeout state, and read or write mode flags.
- Parameters:
modestream
buffer.new(nil, nil)- Description: Read data using Lua-style format arguments or line mode when no format is supplied.
- Parameters:
...
buffer.read(nil)- Description: Flush pending writes if needed, reposition the wrapped stream, and discard cached unread data.
- Parameters:
whenceoffset
buffer.seek(nil, nil)- Description: Replace the per-stream read timeout used by higher-level buffered reads.
- Parameters:
value
buffer.setTimeout(nil)- Description: Configure buffering mode as
no,full, orline, and optionally set the buffer size. - Parameters:
modesize
buffer.setvbuf(nil, nil)- Description: Write strings or numbers to the stream, honoring the active buffering mode.
- Parameters:
...
buffer.write(nil)- Instances returned by
buffer.newwrap a lower-level stream and add line buffering, formatted reads, timeout handling, and file-like helper methods.