Skip to content

Commit

Permalink
Merge pull request #87 from GoogleCloudPlatform:retainableContentChunks
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 592412164
Change-Id: I87d6c655fa7ce00a66d2400176d12e5424bc29d4
  • Loading branch information
gae-java-bot committed Dec 20, 2023
2 parents 8cb0bf1 + ca7a6c1 commit 178dc6a
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 178dc6a

Please sign in to comment.