-1

我的应用程序中有一个输出流,我只想向该流写入 3 个字节。有没有人看到一个很好的例子?字节是:

Byte command1 = 254;
Byte command2 = 108;
Byte command3 = 1;

谢谢

4

1 回答 1

1

感谢您对杰克货车的投票。

我从另一个程序员发布的一些示例软件中找到了我的问题的答案。这是示例代码:

Byte *commandBytes = malloc(3);
commandBytes[0] = (Byte)254;
commandBytes[1] = (Byte)108;
commandBytes[2] = (Byte)1;
[outputStream write:(uint8_t *)commandBytes maxLength:3];

希望这对将来的人有所帮助。

于 2012-08-22T15:50:46.143 回答