Top Inners Fields Constructors Methods
org.eclipse.jetty.io.internal

public abstract Class ByteBufferChunk

extends Object
implements Chunk
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.io.Content.Chunk, org.eclipse.jetty.io.Retainable
Known Direct Subclasses
org.eclipse.jetty.io.internal.ByteBufferChunk.WithReferenceCount, org.eclipse.jetty.io.internal.ByteBufferChunk.WithRetainable, org.eclipse.jetty.io.content.AsyncContent.AsyncChunk
Imports
java.nio.ByteBuffer, java.util.Objects, java.util.concurrent.atomic.AtomicReference, java.util.function.Consumer, org.eclipse.jetty.io.Content, .Retainable, org.eclipse.jetty.util.BufferUtil

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final boolean

Constructor Summary

AccessConstructor and Description
public
ByteBufferChunk(ByteBuffer byteBuffer, boolean last)

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

byteBufferback to summary
private final ByteBuffer byteBuffer
lastback to summary
private final boolean last

Constructor Detail

ByteBufferChunkback to summary
public ByteBufferChunk(ByteBuffer byteBuffer, boolean last)

Method Detail

getByteBufferback to summary
public ByteBuffer getByteBuffer()

Implements org.eclipse.jetty.io.Content.Chunk.getByteBuffer.

Returns:ByteBuffer

Doc from org.eclipse.jetty.io.Content.Chunk.getByteBuffer.

the ByteBuffer of this Chunk

Annotations
@Override
isLastback to summary
public boolean isLast()

Implements org.eclipse.jetty.io.Content.Chunk.isLast.

Returns:boolean

Doc from org.eclipse.jetty.io.Content.Chunk.isLast.

whether this is the last Chunk

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.io.internal back to summary

public Class ByteBufferChunk.ReleasedByConsumer

extends WithReferenceCount
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AtomicReference<Consumer<ByteBuffer>>

Constructor Summary

AccessConstructor and Description
public
ReleasedByConsumer(ByteBuffer byteBuffer, boolean last, Consumer<ByteBuffer> releaser)

Method Summary

Modifier and TypeMethod and Description
public boolean
release()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.WithReferenceCount.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Inherited from org.eclipse.jetty.io.internal.ByteBufferChunk.WithReferenceCount:
canRetainretaintoString

Field Detail

releaserback to summary
private final AtomicReference<Consumer<ByteBuffer>> releaser

Constructor Detail

ReleasedByConsumerback to summary
public ReleasedByConsumer(ByteBuffer byteBuffer, boolean last, Consumer<ByteBuffer> releaser)

Method Detail

releaseback to summary
public boolean release()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.WithReferenceCount.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Doc from org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Returns:boolean

true when the reference count goes to zero or if there was no reference count, false otherwise.

Annotations
@Override
org.eclipse.jetty.io.internal back to summary

public Class ByteBufferChunk.ReleasedByRunnable

extends WithReferenceCount
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AtomicReference<Runnable>

Constructor Summary

AccessConstructor and Description
public
ReleasedByRunnable(ByteBuffer byteBuffer, boolean last, Runnable releaser)

Method Summary

Modifier and TypeMethod and Description
public boolean
release()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.WithReferenceCount.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Inherited from org.eclipse.jetty.io.internal.ByteBufferChunk.WithReferenceCount:
canRetainretaintoString

Field Detail

releaserback to summary
private final AtomicReference<Runnable> releaser

Constructor Detail

ReleasedByRunnableback to summary
public ReleasedByRunnable(ByteBuffer byteBuffer, boolean last, Runnable releaser)

Method Detail

releaseback to summary
public boolean release()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.WithReferenceCount.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Doc from org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Returns:boolean

true when the reference count goes to zero or if there was no reference count, false otherwise.

Annotations
@Override
org.eclipse.jetty.io.internal back to summary

public Class ByteBufferChunk.WithReferenceCount

extends ByteBufferChunk
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.io.internal.ByteBufferChunk.ReleasedByRunnable, org.eclipse.jetty.io.internal.ByteBufferChunk.ReleasedByConsumer

Field Summary

Modifier and TypeField and Description
private final Retainable.ReferenceCounter

Constructor Summary

AccessConstructor and Description
public
WithReferenceCount(ByteBuffer byteBuffer, boolean last)

Method Summary

Modifier and TypeMethod and Description
public boolean
canRetain()

Overrides default org.eclipse.jetty.io.Retainable.canRetain.

Returns whether this resource is referenced counted by calls to retain() and release().

public boolean
release()

Overrides default org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

public void
retain()

Overrides default org.eclipse.jetty.io.Retainable.retain.

Retains this resource, potentially incrementing a reference count if there are resources that will be released.

public String
toString()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.toString.

Returns a string representation of the object.

Inherited from org.eclipse.jetty.io.internal.ByteBufferChunk:
getByteBufferisLast

Field Detail

referencesback to summary
private final Retainable.ReferenceCounter references

Constructor Detail

WithReferenceCountback to summary
public WithReferenceCount(ByteBuffer byteBuffer, boolean last)

Method Detail

canRetainback to summary
public boolean canRetain()

Overrides default org.eclipse.jetty.io.Retainable.canRetain.

Doc from org.eclipse.jetty.io.Retainable.canRetain.

Returns whether this resource is referenced counted by calls to retain() and release().

Implementations may decide that special resources are not not referenced counted (for example, static constants) so calling retain() is a no-operation, and calling release() on those special resources is a no-operation that always returns true.

Returns:boolean

true if calls to retain() are reference counted.

Annotations
@Override
releaseback to summary
public boolean release()

Overrides default org.eclipse.jetty.io.Retainable.release.

Doc from org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Returns:boolean

true when the reference count goes to zero or if there was no reference count, false otherwise.

Annotations
@Override
retainback to summary
public void retain()

Overrides default org.eclipse.jetty.io.Retainable.retain.

Doc from org.eclipse.jetty.io.Retainable.retain.

Retains this resource, potentially incrementing a reference count if there are resources that will be released.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.io.internal back to summary

public Class ByteBufferChunk.WithRetainable

extends ByteBufferChunk
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Retainable

Constructor Summary

AccessConstructor and Description
public
WithRetainable(ByteBuffer byteBuffer, boolean last, Retainable retainable)

Method Summary

Modifier and TypeMethod and Description
public boolean
canRetain()

Overrides default org.eclipse.jetty.io.Retainable.canRetain.

Returns whether this resource is referenced counted by calls to retain() and release().

public boolean
release()

Overrides default org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

public void
retain()

Overrides default org.eclipse.jetty.io.Retainable.retain.

Retains this resource, potentially incrementing a reference count if there are resources that will be released.

public String
toString()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.toString.

Returns a string representation of the object.

Inherited from org.eclipse.jetty.io.internal.ByteBufferChunk:
getByteBufferisLast

Field Detail

retainableback to summary
private final Retainable retainable

Constructor Detail

WithRetainableback to summary
public WithRetainable(ByteBuffer byteBuffer, boolean last, Retainable retainable)

Method Detail

canRetainback to summary
public boolean canRetain()

Overrides default org.eclipse.jetty.io.Retainable.canRetain.

Doc from org.eclipse.jetty.io.Retainable.canRetain.

Returns whether this resource is referenced counted by calls to retain() and release().

Implementations may decide that special resources are not not referenced counted (for example, static constants) so calling retain() is a no-operation, and calling release() on those special resources is a no-operation that always returns true.

Returns:boolean

true if calls to retain() are reference counted.

Annotations
@Override
releaseback to summary
public boolean release()

Overrides default org.eclipse.jetty.io.Retainable.release.

Doc from org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Returns:boolean

true when the reference count goes to zero or if there was no reference count, false otherwise.

Annotations
@Override
retainback to summary
public void retain()

Overrides default org.eclipse.jetty.io.Retainable.retain.

Doc from org.eclipse.jetty.io.Retainable.retain.

Retains this resource, potentially incrementing a reference count if there are resources that will be released.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.io.internal.ByteBufferChunk.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override