diff --git a/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcDigestBuilder.java b/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcDigestBuilder.java index 69381c2a..b3a8ab4f 100644 --- a/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcDigestBuilder.java +++ b/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcDigestBuilder.java @@ -14,11 +14,6 @@ class WarcDigestBuilder { this.digest = MessageDigest.getInstance(digestAlgorithm); } - public void update(String s) { - byte[] bytes = s.getBytes(); - update(bytes, bytes.length); - } - public void update(byte[] bytes) { update(bytes, bytes.length); } diff --git a/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcRecorder.java b/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcRecorder.java index b9d44310..23ab4766 100644 --- a/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcRecorder.java +++ b/code/processes/crawling-process/src/main/java/nu/marginalia/crawl/retreival/fetcher/warc/WarcRecorder.java @@ -145,14 +145,16 @@ public class WarcRecorder implements AutoCloseable { WarcDigestBuilder requestDigestBuilder = new WarcDigestBuilder(); - String httpRequestString = WarcProtocolReconstructor.getHttpRequestString(response.request(), requestUri); + byte[] httpRequestString = WarcProtocolReconstructor + .getHttpRequestString(response.request(), requestUri) + .getBytes(); requestDigestBuilder.update(httpRequestString); WarcRequest warcRequest = new WarcRequest.Builder(requestUri) .blockDigest(requestDigestBuilder.build()) .date(date) - .body(MediaType.HTTP_REQUEST, httpRequestString.getBytes()) + .body(MediaType.HTTP_REQUEST, httpRequestString) .concurrentTo(warcResponse.id()) .build(); @@ -322,7 +324,7 @@ public class WarcRecorder implements AutoCloseable { } } - private class ResponseDataBuffer { + private static class ResponseDataBuffer { private final byte[] data; private int length = 0; private int pos = 0;