Skip to content

Commit

Permalink
make ContentChunk retainable so multipart can use the chunks
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed Dec 19, 2023
1 parent f410df1 commit 61d6e66
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@

import java.nio.ByteBuffer;
import java.util.Objects;

import org.eclipse.jetty.io.Content;
import org.eclipse.jetty.io.Retainable;
import org.eclipse.jetty.util.BufferUtil;

public class ContentChunk implements Content.Chunk {
public class ContentChunk extends Retainable.ReferenceCounter implements Content.Chunk {
private final ByteBuffer byteBuffer;
private final boolean last;

public ContentChunk(ByteBuffer byteBuffer) {
this(byteBuffer, true);
}

public ContentChunk(byte[] bytes) {
this(BufferUtil.toBuffer(bytes), true);
}
Expand All @@ -48,16 +46,6 @@ public boolean isLast() {
return last;
}

@Override
public void retain() {
throw new UnsupportedOperationException();
}

@Override
public boolean release() {
return true;
}

@Override
public String toString() {

Expand Down

0 comments on commit 61d6e66

Please sign in to comment.