ByteBuffer (ext)
You’re viewing third-party extensions to ByteBuffer
, a struct from swift-nio.
You can also read the documentation forByteBuffer
itself.
extension ByteBuffer
You’re viewing third-party extensions to ByteBuffer
, a struct from swift-nio.
You can also read the documentation forByteBuffer
itself.
extension ByteBuffer
struct ByteBuffer
ByteBuffer
stores contiguously allocated raw bytes. It is a random and sequential accessible sequence of zero or more bytes (octets).
import CompressNIO
mutating func compress(to buffer: inout ByteBuffer, with algorithm: CompressionAlgorithm) throws
Compress the readable contents of this byte buffer into another using the compression algorithm specified
mutating func compress(to buffer: inout ByteBuffer, with algorithm: ZlibAlgorithm, configuration: ZlibConfiguration = .init()) throws
Compress the readable contents of this byte buffer into another using the compression algorithm specified
mutating func compress(with algorithm: CompressionAlgorithm, allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
Allocate a new byte buffer and compress this byte buffer into it using the compression algorithm specified
mutating func compress(with algorithm: ZlibAlgorithm, configuration: ZlibConfiguration = .init(), allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
Allocate a new byte buffer and compress this byte buffer into it using the compression algorithm specified
mutating func compressStream(to byteBuffer: inout ByteBuffer, with compressor: NIOCompressor, flush: CompressNIOFlush) throws
Compress one byte buffer from a stream of blocks into another bytebuffer
mutating func compressStream(to byteBuffer: inout ByteBuffer, with compressor: ZlibCompressor, flush: CompressNIOFlush) throws
Compress one byte buffer from a stream of blocks into another bytebuffer
mutating func compressStream(with compressor: NIOCompressor, flush: CompressNIOFlush, allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
A version of compressStream which allocates the ByteBuffer to write into.
mutating func compressStream(with compressor: ZlibCompressor, flush: CompressNIOFlush, allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
A version of compressStream which allocates the ByteBuffer to write into.
mutating func compressStream(with compressor: NIOCompressor, flush: CompressNIOFlush, process: (ByteBuffer) throws -> Void) throws
A version of compressStream which you provide a fixed sized window buffer to and a process closure.
mutating func compressStream(with compressor: NIOCompressor, flush: CompressNIOFlush, process: (ByteBuffer) async throws -> Void) async throws
A version of compressStream which you provide a fixed sized window buffer to and a process closure.
mutating func compressStream(with compressor: ZlibCompressor, window: inout ByteBuffer, flush: CompressNIOFlush, process: (ByteBuffer) throws -> Void) throws
A version of compressStream which you provide a fixed sized window buffer to and a process closure.
mutating func compressStream(with compressor: ZlibCompressor, window: inout ByteBuffer, flush: CompressNIOFlush, process: (ByteBuffer) async throws -> Void) async throws
A version of compressStream which you provide a fixed sized window buffer to and a process closure.
mutating func decompress(to buffer: inout ByteBuffer, with algorithm: CompressionAlgorithm) throws
Decompress the readable contents of this byte buffer into another using the compression algorithm specified.
mutating func decompress(to buffer: inout ByteBuffer, with algorithm: ZlibAlgorithm, configuration: ZlibConfiguration = .init()) throws
Decompress the readable contents of this byte buffer into another using the compression algorithm specified.
mutating func decompress(with algorithm: ZlibAlgorithm, configuration: ZlibConfiguration = .init(), maxSize: Int = .max, allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
Allocate a ByteBuffer
to decompress this buffer into. Decompress the readable contents of this byte buffer into the allocated buffer. If the allocated buffer is too small allocate more space and continue the decompression.
mutating func decompress(with algorithm: CompressionAlgorithm, maxSize: Int = .max, allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
Allocate a ByteBuffer
to decompress this buffer into. Decompress the readable contents of this byte buffer into the allocated buffer. If the allocated buffer is too small allocate more space and continue the decompression.
mutating func decompressStream(to byteBuffer: inout ByteBuffer, with decompressor: NIODecompressor) throws
Decompress one byte buffer from a stream of blocks out of a compressed bytebuffer
mutating func decompressStream(to byteBuffer: inout ByteBuffer, with decompressor: ZlibDecompressor) throws
Decompress one byte buffer from a stream of blocks out of a compressed bytebuffer
mutating func decompressStream(with decompressor: NIODecompressor, maxSize: Int = .max, allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
A version of decompressStream which allocates the ByteBuffer to write into.
mutating func decompressStream(with decompressor: ZlibDecompressor, maxSize: Int = .max, allocator: ByteBufferAllocator = ByteBufferAllocator()) throws -> ByteBuffer
A version of decompressStream which allocates the ByteBuffer to write into.
mutating func decompressStream(with decompressor: NIODecompressor, process: (ByteBuffer) throws -> Void) throws
A version of decompressStream which you provide a fixed sized window buffer to and a process closure.
mutating func decompressStream(with decompressor: NIODecompressor, process: (ByteBuffer) async throws -> Void) async throws
A version of decompressStream which you provide a fixed sized window buffer to and a process closure.
mutating func decompressStream(with decompressor: ZlibDecompressor, window: inout ByteBuffer, process: (ByteBuffer) throws -> Void) throws
A version of decompressStream which you provide a fixed sized window buffer to and a process closure.
mutating func decompressStream(with decompressor: ZlibDecompressor, window: inout ByteBuffer, process: (ByteBuffer) async throws -> Void) async throws
A version of decompressStream which you provide a fixed sized window buffer to and a process closure.
mutating func withUnsafeProcess(to: inout ByteBuffer, closure: (UnsafeMutableRawBufferPointer, UnsafeMutableRawBufferPointer) throws -> Void) throws
Process unsafe version of readable data and write out to unsafe writable data of another ByteBuffer