IOData
public enum IOData
extension IOData: Equatable
extension IOData: CustomStringConvertible
IOData
unifies standard SwiftNIO types that are raw bytes of data; currently ByteBuffer
and FileRegion
.
Many ChannelHandler
s receive or emit bytes and in most cases this can be either a ByteBuffer
or a FileRegion
from disk. To still form a well-typed ChannelPipeline
such handlers should receive and emit value of type IOData
.
-
A
ByteBuffer
.Declaration
Swift
case byteBuffer(ByteBuffer)
-
A
FileRegion
.Sending a
FileRegion
through theChannelPipeline
usingwrite
can be useful because someChannel
s can usesendfile
to send aFileRegion
more efficiently.Declaration
Swift
case fileRegion(FileRegion)
-
Returns the number of readable bytes in this
IOData
.Declaration
Swift
public var readableBytes: Int { get }
-
Move the readerIndex forward by
offset
.Declaration
Swift
public mutating func moveReaderIndex(forwardBy: Int)
-
Declaration
Swift
public var description: String { get }