file_system_serializer
messageflux.iodevices.file_system.file_system_serializer
ConcatFileSystemSerializer
Bases: FileSystemSerializerBase
this serializer concats the headers line with the message bytes it serializes the stream and headers into a single file
deserialize
deserializes the message from the stream
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream |
BinaryIO
|
the stream to deserialize from |
required |
Returns:
| Type | Description |
|---|---|
Message
|
the deserialized message |
serialize
serializes the message into a stream to write to file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
Message
|
the message to serialize |
required |
Returns:
| Type | Description |
|---|---|
BinaryIO
|
a stream containing the serialized message |
FileSystemSerializerBase
this is a base class for FileSystemSerializer
deserialize
abstractmethod
deserializes the message from the stream
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream |
BinaryIO
|
the stream to deserialize from |
required |
Returns:
| Type | Description |
|---|---|
Message
|
the deserialized message |
serialize
abstractmethod
serializes the message into a stream to write to file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
Message
|
the message to serialize |
required |
Returns:
| Type | Description |
|---|---|
BinaryIO
|
a stream containing the serialized message |
NoHeadersFileSystemSerializer
Bases: FileSystemSerializerBase
this is a serializer for filesystem, that ignores the headers, and just puts the stream as the content of the file
deserialize
deserializes the stream into the stream of the message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream |
BinaryIO
|
the stream to deserialize from |
required |
Returns:
| Type | Description |
|---|---|
Message
|
the deserialized message |
serialize
serializes the message stream only
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
Message
|
the message to serialize |
required |
Returns:
| Type | Description |
|---|---|
BinaryIO
|
a stream containing the serialized message |
ZIPFileSystemSerializer
Bases: FileSystemSerializerBase
this serializer, creates a zip file, with two inner files: the buffer, and headers
deserialize
deserializes the message from the stream
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream |
BinaryIO
|
the stream to deserialize from |
required |
Returns:
| Type | Description |
|---|---|
Message
|
the deserialized message |
serialize
serializes the message into a stream to write to file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
Message
|
the message to serialize |
required |
Returns:
| Type | Description |
|---|---|
BinaryIO
|
a stream containing the serialized message |