Skip to content

Commit

Permalink
refactor: use existing method
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulaziz1928 authored and marcelmay committed May 30, 2024
1 parent adf5c76 commit 3b66d73
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private void handleBodyFetch(MimeMessage mimeMessage,
} else if (content instanceof InputStream) {
byte[] bytes = readAllBytes((InputStream) content);
bytes = doPartial(partial, bytes, response);
addLiteralStream(bytes, response);
addLiteral(bytes, response);
} else {
MimeMultipart mp = (MimeMultipart) content;
BodyPart part = null;
Expand Down Expand Up @@ -320,17 +320,6 @@ private void addLiteral(byte[] bytes, StringBuilder response) {
}
}

private void addLiteralStream(byte[] bytes, StringBuilder response) {
response.append('{');
response.append(bytes.length);
response.append('}');
response.append("\r\n");

for (byte b : bytes) {
response.append((char) (b));
}
}

// TODO should do this at parse time.
private String[] extractHeaderList(String headerList, int prefixLen) {
// Remove the trailing and leading ')('
Expand Down

0 comments on commit 3b66d73

Please sign in to comment.