java - Eclipse 在调试时显示 Java 字节数组的红色值

标签 java arrays eclipse debugging rxtx

我目前正在开发一个软件,该软件使用 RXTX 库与手工制作的模拟器进行串行通信。为了测试我的软件的极限,我在两个程序之间设置了不同的 COM 参数;主软件发送消息波特率为9600,模拟器接收波特率为19200。

当我尝试发送以下数组:"GET IN_NUM_TRAIN".getBytes()(16 字节)时,我的模拟器收到一个包含 27 个元素的字节数组并抛出:

INFOS: Traitement du message : ~�``�8���f���f�

java.lang.StringIndexOutOfBoundsException: String index out of range: 26

当我尝试调试代码时,收到的字节数组如下所示:

Byte array displayed by Eclipse

我不明白为什么前 8 个值显示为红色。

最佳答案

前 8 个显示为红色,表示它们已更改

参见Eclipse Help - Java development user guide > Reference > Preferences > Debug Preferences :

Changed value color

This option allows you to change the color of a changed value in the variables view, expressions view, memory view, anywhere running program variables are rendered

Default: Red

关于java - Eclipse 在调试时显示 Java 字节数组的红色值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58996834/

相关文章:

java - 为什么我不能在 arraylist 中使用 getFixed 方法?我怎样才能让它发挥作用?

javascript - 在不拆分数组或创建新数组的情况下搜索数组以查找峰值的最佳方法,javascript

eclipse - 无法在 Eclipse 中导入 github 项目

eclipse - Ubuntu 12.04 Eclipse Indigo 无法启动

java - 例如,我如何区分 hello1 和 hello 11?

java - java中抽象类适合什么场景使用?

java - 处理java程序延迟执行的问题

c++ - 如何将文本文件中的数据读入结构的int数组?

javascript - 打印对象数组

java - Eclipse:Junit 我在下面的 junit 选项卡中看到此错误