* @param headerReceived header (first 8 bytes) of expected message
*/
public void setHeaderReceived(byte[] headerReceived) {
- this.headerReceived = new byte[headerReceived.length];
- for (int i = 0; i < headerReceived.length; i++) {
- this.headerReceived[i] = headerReceived[i];
+ if (headerReceived != null) {
+ this.headerReceived = new byte[headerReceived.length];
+ for (int i = 0; i < headerReceived.length; i++) {
+ this.headerReceived[i] = headerReceived[i];
+ }
}
}
}