- public void setGateCommandType(short type) {
- setShort(type, (short) 2);
+ protected byte[] getBytes() {
+ final byte[] transIdBytes = COPSMsgParser.shortToBytes(transId);
+ final byte[] data = new byte[transIdBytes.length + transIdBytes.length];
+ System.arraycopy(transIdBytes, 0, data, 0, transIdBytes.length);
+
+ final byte[] gateCmdBytes = COPSMsgParser.shortToBytes(gateCommandType.getValue());
+ System.arraycopy(gateCmdBytes, 0, data, transIdBytes.length, gateCmdBytes.length);
+ return data;