private void writeCorpusFile(final byte[] buf) throws NoSuchAlgorithmException {
    if (this.corpusPath != null) {
      MessageDigest md = MessageDigestFactory.create("SHA-256");
      md.update(buf);
      byte[] digest = md.digest();
      String hex = String.format("%064x", new BigInteger(1, digest));
      try (FileOutputStream fos = new FileOutputStream(this.corpusPath + "/" + hex)) {
        fos.write(buf);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
Create a corpus

@param dirs The directory to store the corpus files
testfuzz/src/main/java/org/hyperledger/besu/testfuzz/javafuzz/Corpus.java