OSCCore icon indicating copy to clipboard operation
OSCCore copied to clipboard

Utilize NIO ByteBuffer in serialization

Open segabor opened this issue 5 years ago • 1 comments

NIO provides a useful type for serializing stuff into byte stream, ByteBuffer. Actual implementation simply concatenates output into [UInt8]. ByteBuffer covers this function way better.

Affected types

  • OSCConvertible protocol that defines serialization, particularly
    • var oscValue: [Byte]? { get } - provides serialized value as bytes array
    • init?(data: [Byte]) and init?(data: ArraySlice<Byte>) constructors. They make up types from bytes stream
  • conversion module is where serialization stuff takes place
    • extract.swift the entry point of decoding OSC packets.
    • Constructors of OSCMessage and OSCBundle where all the decoding happens.
  • Tests/OSCCoreTests/ValueConversionTests test suite.

This ticket also affects #16

segabor avatar Jan 14 '19 10:01 segabor