SFByteWriter

Objective-C

@interface SFByteWriter : NSObject

Swift

class SFByteWriter : NSObject

Write byte data

  • Next byte index to write

    Declaration

    Objective-C

    @property int nextByte;

    Swift

    var nextByte: Int32 { get set }
  • os

    Output stream to write bytes to

    Declaration

    Objective-C

    @property (nonatomic, strong) NSOutputStream *os;

    Swift

    var os: OutputStream! { get set }
  • Byte order used to write, little or big endian

    Declaration

    Objective-C

    @property (nonatomic) CFByteOrder byteOrder;

    Swift

    var byteOrder: CFByteOrder { get set }
  • Initialize

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    new byte writer

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithByteOrder:(CFByteOrder)byteOrder;

    Swift

    init!(byteOrder: CFByteOrder)

    Parameters

    byteOrder

    byte order

    Return Value

    new byte writer

  • Close the byte writer

    Declaration

    Objective-C

    - (void)close;

    Swift

    func close()
  • Get the written byte data

    Declaration

    Objective-C

    - (NSData *)data;

    Swift

    func data() -> Data!

    Return Value

    byte data

  • Get the current size in bytes written

    Declaration

    Objective-C

    - (int)size;

    Swift

    func size() -> Int32

    Return Value

    bytes written

  • Write a string

    Declaration

    Objective-C

    - (void)writeString:(NSString *)value;

    Swift

    func write(_ value: String!)

    Parameters

    value

    string

  • Write a byte

    Declaration

    Objective-C

    - (void)writeByte:(NSNumber *)value;

    Swift

    func writeByte(_ value: NSNumber!)

    Parameters

    value

    byte

  • Write data

    Declaration

    Objective-C

    - (void)writeData:(NSData *)data;

    Swift

    func writeData(_ data: Data!)

    Parameters

    data

    data

  • Write an integer

    Declaration

    Objective-C

    - (void)writeInt:(NSNumber *)value;

    Swift

    func writeInt(_ value: NSNumber!)

    Parameters

    value

    integer

  • Write a double

    Declaration

    Objective-C

    - (void)writeDouble:(NSDecimalNumber *)value;

    Swift

    func writeDouble(_ value: NSDecimalNumber!)

    Parameters

    value

    double