public static void check(byte[] payload, int index, int value) { byte found = payload[index]; if (found != value) { throw new IllegalStateException(format( "invalid byte at index:%d, found:%02X, expected:%02X payload=", index, found, value) + toHexString(payload)); } }
public static void check(byte[] payload, int index, int value) { byte found = payload[index]; if (found != value) { throw new IllegalStateException(format( "invalid byte at index:%d, found:%02X, expected:%02X payload=", index, found, value) + toHexString(payload)); } }
public static void check(byte[] payload, int index, int value) { byte found = payload[index]; if (found != value) { throw new IllegalStateException(format( "invalid byte at index:%d, found:%02X, expected:%02X payload=", index, found, value) + toHexString(payload)); } }
public static void main(String[] args) { byte[] bytes = new byte[50]; long sequenceId = Long.MAX_VALUE; addHeadTailMarkers(bytes); addSequenceId(bytes, sequenceId); writeLong(bytes, 3, sequenceId); writeLong(bytes, bytes.length - (8 + 3), sequenceId); LOGGER.info(toHexString(bytes)); checkHeadTailMarkers(bytes); } }
public static void main(String[] args) { byte[] bytes = new byte[50]; long sequenceId = Long.MAX_VALUE; addHeadTailMarkers(bytes); addSequenceId(bytes, sequenceId); writeLong(bytes, 3, sequenceId); writeLong(bytes, bytes.length - (8 + 3), sequenceId); LOGGER.info(toHexString(bytes)); checkHeadTailMarkers(bytes); } }
public static void main(String[] args) { byte[] bytes = new byte[50]; long sequenceId = Long.MAX_VALUE; addHeadTailMarkers(bytes); addSequenceId(bytes, sequenceId); writeLong(bytes, 3, sequenceId); writeLong(bytes, bytes.length - (8 + 3), sequenceId); LOGGER.info(toHexString(bytes)); checkHeadTailMarkers(bytes); } }