FirmwareImage implements Chunk.Chunkable { public int sizeBytes() { return rawData.length; } FirmwareImage(byte[] rawData, String filename); byte[] data(); String name(); int sizeBytes(); long version(); @Override byte[] getChunkableData(); int crc(); int crcShadow(); int intVersion(); int length(); byte[] uniqueID(); byte[] reserved(); byte[] metadata(); int blockCount(); byte[] block(int index);  }
@Test public void testSizeBytes() throws ImageParsingException { FirmwareImage image1 = new FirmwareImage(rawImageData_valid, ""); FirmwareImage image2 = new FirmwareImage(rawImageData_invalid, ""); assertThat(image1.sizeBytes()).isEqualTo(16); assertThat(image2.sizeBytes()).isEqualTo(42); }