private static byte[] EncodingToBytes(CBORObject b) { try { using (var ms = new MemoryStream()) { BEncoding.Write(b, ms); return ms.ToArray(); } } catch (IOException ex) { throw new CBORException(String.Empty, ex); } }