nlib
nn::nlib::oss::Lz4OutputStream Class Referencefinal

The stream class to write data according to the LZ4 frame format. More...

#include "nn/nlib/oss/Lz4OutputStream.h"

+ Inheritance diagram for nn::nlib::oss::Lz4OutputStream:

Public Member Functions

Constructor, Destructor, and Initialization
constexpr Lz4OutputStream () noexcept
 Instantiates the object with default parameters (default constructor). Requires initialization with Init() after execution.
 
virtual ~Lz4OutputStream () noexcept override
 Destructor. If the stream has not been closed, it will be closed. However, this will not allow errors to be obtained. Be sure to close it explicitly.
 
errno_t Init () noexcept
 A parameter omitted version of the above function which passes settings as the default value.
 
errno_t Init (const Lz4OutputStreamSettings &settings) noexcept
 Initializes by specifying the behavior option. Returns 0 if successful. More...
 
- Public Member Functions inherited from nn::nlib::OutputConverterStream
errno_t SetStream (OutputStream *ostr) noexcept
 Sets an output stream as the base stream. More...
 
OutputStreamGetStream () const noexcept
 Gets the input stream that will be the base stream. More...
 
- Public Member Functions inherited from nn::nlib::OutputStream
size_t Pos () const noexcept
 Returns the current position in the stream. More...
 
uint64_t Pos64 () const noexcept
 Returns the current position in the stream as a 64-bit integer. More...
 
bool Write (int b) noexcept
 Writes one byte of data to the stream. More...
 
bool Write (const void *p, size_t n) noexcept
 Writes n bytes of data to the stream. More...
 
bool WriteGather (const nlib_fd_iovec *iov, int iovcnt) noexcept
 Writes data from multiple non-continuous buffers to a stream. More...
 
bool Flush () noexcept
 Flushes the stream. More...
 
bool Close () noexcept
 Closes the stream after it has been flushed. Returns true if successful. More...
 
errno_t GetErrorValue () const noexcept
 Gets the error value. More...
 
BufferingMode GetBufferingMode () const noexcept
 Gets the buffering mode.
 
 operator bool () const
 Returns true if the object has been initialized and an error has not occurred inside, or returns false if an error has occurred inside.
 
constexpr OutputStream () noexcept
 Instantiates the object with default parameters (default constructor).
 
virtual ~OutputStream () noexcept
 Destructor.
 

Additional Inherited Members

- Public Types inherited from nn::nlib::OutputStream
enum  BufferingMode {
  kBufferingModeBlockBuffered = 0,
  kBufferingModeLineBuffered,
  kBufferingModeUnbuffered
}
 The buffering mode for OutputStream. More...
 
- Protected Member Functions inherited from nn::nlib::OutputStream
void ResetBuffer (void *p, size_t nbytes) noexcept
 Sets the buffer held by OutputStream. More...
 
void SetError (errno_t e) const noexcept
 Sets an error to OutputStream. More...
 
- Protected Attributes inherited from nn::nlib::OutputStream
BufferingMode m_BufferingMode
 Stores the buffering mode. More...
 

Detailed Description

The stream class to write data according to the LZ4 frame format.

Description
Although the LZ4 frame format also supports multi-thread encoding, this class runs only in a single thread.
The transition of the object state.
The overview of the object state transitions is described below:
dot_inline_dotgraph_16.png

Definition at line 54 of file Lz4OutputStream.h.

Member Function Documentation

◆ Init()

nn::nlib::oss::Lz4OutputStream::Init ( const Lz4OutputStreamSettings settings)
noexcept

Initializes by specifying the behavior option. Returns 0 if successful.

Parameters
[in]settingsBehavior options.
Return values
0Success.
EALREADYAlready initialized.
ENOMEMIndicates that internal memory allocation failed.
EINVALIndicates that the specification of behavior options was invalid.
EINVALInvalid settings.

The documentation for this class was generated from the following files: