test_class.declarator: rawImageData_valid = intArrayToByteArray(new int[] {
  
              // Header data (first and only block)
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x41, 0x41, 0x41, 0x41,    // AAAA
              0xFF, 0xFF, 0xFF, 0xFF     // Reserved
      })
test_class.original_string: byte[] rawImageData_valid = intArrayToByteArray(new int[] {
  
              // Header data (first and only block)
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x41, 0x41, 0x41, 0x41,    // AAAA
              0xFF, 0xFF, 0xFF, 0xFF     // Reserved
      });
test_class.type: byte[]
test_class.var_name: rawImageData_valid
test_class.declarator: rawImageData_tooShort = intArrayToByteArray(new int[] {
              0x2B, 0x65, 0xFF, 0xFF,
      })
test_class.original_string: byte[] rawImageData_tooShort = intArrayToByteArray(new int[] {
              0x2B, 0x65, 0xFF, 0xFF,
      });
test_class.type: byte[]
test_class.var_name: rawImageData_tooShort
test_class.declarator: rawImageData_invalid = intArrayToByteArray(new int[] {
  
              // Valid header - 16 bytes data
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x41, 0x41, 0x41, 0x41,    // AAAA
              0xFF, 0xFF, 0xFF, 0xFF,     // Reserved
  
              // Valid block - 16 bytes of image data
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF, 0xFF, 0xFF,
              0xFF, 0xFF, 0xFF, 0xFF,
  
              // Invalid block - only 10 bytes of image data
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF
  
      })
test_class.original_string: byte[] rawImageData_invalid = intArrayToByteArray(new int[] {
  
              // Valid header - 16 bytes data
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x41, 0x41, 0x41, 0x41,    // AAAA
              0xFF, 0xFF, 0xFF, 0xFF,     // Reserved
  
              // Valid block - 16 bytes of image data
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF, 0xFF, 0xFF,
              0xFF, 0xFF, 0xFF, 0xFF,
  
              // Invalid block - only 10 bytes of image data
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF,
              0xFF, 0xFF
  
      });
test_class.type: byte[]
test_class.var_name: rawImageData_invalid
test_class.file: sdk/src/test/java/com/punchthrough/bean/sdk/upload/FirmwareImageTest.java
test_class.identifier: FirmwareImageTest
test_case.body: @Test
      public void testFirmwareBlocksValid() throws ImageParsingException {
          FirmwareImage image1 = new FirmwareImage(rawImageData_valid, "");
  
          assertThat(image1.block(0)).isEqualTo(intArrayToByteArray(new int[]{
  
                  // Block index (0x0000 little endian)
                  0x00, 0x00,
  
                  // Block data
                  0x2B, 0x65,                // CRC
                  0xFF, 0xFF,                // CRC Shadow
                  0x64, 0x00,                // Version
                  0x00, 0x7C,                // Length
                  0x41, 0x41, 0x41, 0x41,    // AAAA
                  0xFF, 0xFF, 0xFF, 0xFF     // Reserved
          }));
  
          try {
              image1.block(1);
              fail("Shouldn't have worked");
          } catch (ArrayIndexOutOfBoundsException e) {
              assertThat(e).isNotNull();
          }
  
      }
test_case.class_method_signature: FirmwareImageTest.testFirmwareBlocksValid()
test_case.full_signature: @Test public void testFirmwareBlocksValid()
test_case.identifier: testFirmwareBlocksValid
test_case.invocations: isEqualTo assertThat block intArrayToByteArray block fail isNotNull assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFirmwareBlocksValid()
focal_class.declarator: FW_BLOCK_SIZE = 16
focal_class.modifier: private static final
focal_class.original_string: private static final int FW_BLOCK_SIZE = 16;
focal_class.type: int
focal_class.var_name: FW_BLOCK_SIZE
focal_class.declarator: rawData
focal_class.modifier: private
focal_class.original_string: private byte[] rawData;
focal_class.type: byte[]
focal_class.var_name: rawData
focal_class.declarator: filename
focal_class.modifier: private
focal_class.original_string: private String filename;
focal_class.type: String
focal_class.var_name: filename
focal_class.file: sdk/src/main/java/com/punchthrough/bean/sdk/upload/FirmwareImage.java
focal_class.identifier: FirmwareImage
focal_class.interfaces: implements Chunk.Chunkable
focal_class.class_method_signature: FirmwareImage.FirmwareImage(byte[] rawData, String filename)
focal_class.full_signature: public  FirmwareImage(byte[] rawData, String filename)
focal_class.identifier: FirmwareImage
focal_class.modifiers: public
focal_class.parameters: (byte[] rawData, String filename)
focal_class.signature:  FirmwareImage(byte[] rawData, String filename)
focal_class.class_method_signature: FirmwareImage.uint16FromData(int offset)
focal_class.full_signature: private int uint16FromData(int offset)
focal_class.identifier: uint16FromData
focal_class.modifiers: private
focal_class.parameters: (int offset)
focal_class.return: int
focal_class.signature: int uint16FromData(int offset)
focal_class.class_method_signature: FirmwareImage.uint8_4FromData(int offset)
focal_class.full_signature: private byte[] uint8_4FromData(int offset)
focal_class.identifier: uint8_4FromData
focal_class.modifiers: private
focal_class.parameters: (int offset)
focal_class.return: byte[]
focal_class.signature: byte[] uint8_4FromData(int offset)
focal_class.class_method_signature: FirmwareImage.data()
focal_class.full_signature: public byte[] data()
focal_class.identifier: data
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] data()
focal_class.class_method_signature: FirmwareImage.name()
focal_class.full_signature: public String name()
focal_class.identifier: name
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String name()
focal_class.class_method_signature: FirmwareImage.sizeBytes()
focal_class.full_signature: public int sizeBytes()
focal_class.identifier: sizeBytes
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int sizeBytes()
focal_class.class_method_signature: FirmwareImage.version()
focal_class.full_signature: public long version()
focal_class.identifier: version
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long version()
focal_class.class_method_signature: FirmwareImage.getChunkableData()
focal_class.full_signature: @Override public byte[] getChunkableData()
focal_class.identifier: getChunkableData
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] getChunkableData()
focal_class.class_method_signature: FirmwareImage.crc()
focal_class.full_signature: public int crc()
focal_class.identifier: crc
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int crc()
focal_class.class_method_signature: FirmwareImage.crcShadow()
focal_class.full_signature: public int crcShadow()
focal_class.identifier: crcShadow
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int crcShadow()
focal_class.class_method_signature: FirmwareImage.intVersion()
focal_class.full_signature: public int intVersion()
focal_class.identifier: intVersion
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int intVersion()
focal_class.class_method_signature: FirmwareImage.length()
focal_class.full_signature: public int length()
focal_class.identifier: length
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int length()
focal_class.class_method_signature: FirmwareImage.uniqueID()
focal_class.full_signature: public byte[] uniqueID()
focal_class.identifier: uniqueID
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] uniqueID()
focal_class.class_method_signature: FirmwareImage.reserved()
focal_class.full_signature: public byte[] reserved()
focal_class.identifier: reserved
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] reserved()
focal_class.class_method_signature: FirmwareImage.metadata()
focal_class.full_signature: public byte[] metadata()
focal_class.identifier: metadata
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] metadata()
focal_class.class_method_signature: FirmwareImage.blockCount()
focal_class.full_signature: public int blockCount()
focal_class.identifier: blockCount
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int blockCount()
focal_class.class_method_signature: FirmwareImage.block(int index)
focal_class.full_signature: public byte[] block(int index)
focal_class.identifier: block
focal_class.modifiers: public
focal_class.parameters: (int index)
focal_class.return: byte[]
focal_class.signature: byte[] block(int index)
focal_method.body: public byte[] block(int index) {
  
          if (index >= blockCount()) {
              throw new ArrayIndexOutOfBoundsException("Invalid block index " + index);
          }
  
          byte[] theBlock = new byte[FW_BLOCK_SIZE + 2];
  
          // Copy the UINT16 block index into the array (2 bytes)
          byte[] rawIndex = intToTwoBytes(index, Constants.CC2540_BYTE_ORDER);
          System.arraycopy(rawIndex, 0, theBlock, 0, 2);
  
          // Copy the block data into the array (16 bytes)
          int blockStart = index * FW_BLOCK_SIZE;
          int length = FW_BLOCK_SIZE;
          while (blockStart + length > data().length) { length--; }
          System.arraycopy(data(), blockStart, theBlock, 2, length);
  
          return theBlock;
      }
focal_method.class_method_signature: FirmwareImage.block(int index)
focal_method.full_signature: public byte[] block(int index)
focal_method.identifier: block
focal_method.invocations: blockCount intToTwoBytes arraycopy data arraycopy data
focal_method.modifiers: public
focal_method.parameters: (int index)
focal_method.return: byte[]
focal_method.signature: byte[] block(int index)