code: private static byte[] convertLinesToBytes(List<Line> lines) {
          List<Line> dataLines = new ArrayList<>();
          int byteCount = 0;
          for (Line line : lines) {
              if (line.getRecordType() == LineRecordType.DATA) {
                  dataLines.add(line);
                  byteCount += line.getByteCount();
              }
          }
  
          byte[] bytes = new byte[byteCount];
          int i = 0;
          for (Line line : dataLines) {
              for (byte b : line.getData()) {
                  bytes[i] = b;
                  i++;
              }
          }
  
          return bytes;
      }
docs: Convert a list of Intel Hex {@link com.punchthrough.bean.sdk.internal.intelhex.Line} objects
  to an array of the raw bytes they represent.
  
  @param lines The List of {@link com.punchthrough.bean.sdk.internal.intelhex.Line} objects
  @return      An array of raw bytes represented by the
  {@link com.punchthrough.bean.sdk.internal.intelhex.Line} objects