From af61d6e4d4397f4e88d0ca57bc08f26de37c878e Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Wed, 17 Jan 2024 15:49:40 +0100 Subject: [PATCH] Fix for buffer data when created with an offset. Signed-off-by: Tomas Langer --- .../main/java/io/helidon/common/buffers/FixedBufferData.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/buffers/src/main/java/io/helidon/common/buffers/FixedBufferData.java b/common/buffers/src/main/java/io/helidon/common/buffers/FixedBufferData.java index fcf1dd7e2db..5da3918c37c 100644 --- a/common/buffers/src/main/java/io/helidon/common/buffers/FixedBufferData.java +++ b/common/buffers/src/main/java/io/helidon/common/buffers/FixedBufferData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Oracle and/or its affiliates. + * Copyright (c) 2022, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ class FixedBufferData implements BufferData { FixedBufferData(byte[] bytes, int position, int length) { this.bytes = bytes; this.length = length; - this.writePosition = length; + this.writePosition = position + length; this.readPosition = position; }