From 66b494dabe14a87822e2cc0e4381dc95569cedc9 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Tue, 5 Nov 2024 17:10:48 +0100 Subject: [PATCH] #12469 - use faster UTF8 encoding Signed-off-by: Ludovic Orban --- .../src/main/java/org/eclipse/jetty/http/MultiPart.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPart.java b/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPart.java index 09f45406ee56..ef60d2e46454 100644 --- a/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPart.java +++ b/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPart.java @@ -765,7 +765,7 @@ public Content.Chunk read() builder.append("\r\n"); // TODO: use a ByteBuffer pool and direct ByteBuffers? - ByteBuffer byteBuffer = UTF_8.encode(builder.toCompleteString()); + ByteBuffer byteBuffer = ByteBuffer.wrap(builder.toCompleteString().getBytes(UTF_8)); state = State.CONTENT; yield Content.Chunk.from(byteBuffer, false); }