public OscWriter(MemoryStream buffer) { flipper32 = new BitFlipper32(); this.buffer = buffer ?? throw new ArgumentNullException(nameof(buffer)); argumentBuffer = new byte[16]; argumentBufferCount = 0; count = 0; state = WriterState.NotStarted; }
public OscReader(ArraySegment <byte> buffer) { if (buffer.Count % 4 != 0) { throw new OscException(OscError.InvalidSegmentLength, "The packet length is not the correct size"); } this.buffer = buffer; currentToken = OscToken.OscAddress; flipper32 = new BitFlipper32(); Position = 0; maxPosition = buffer.Count; }