Class Content.Chunk.Empty
java.lang.Object
org.eclipse.jetty.io.Content.Chunk.Empty
- All Implemented Interfaces:
Content.Chunk
,Retainable
,RetainableByteBuffer
- Direct Known Subclasses:
Trailers
- Enclosing interface:
Content.Chunk
An empty chunk implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Content.Chunk
Content.Chunk.Empty, Content.Chunk.Processor
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Retainable
Retainable.ReferenceCounter
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.RetainableByteBuffer
RetainableByteBuffer.Abstract, RetainableByteBuffer.DynamicCapacity, RetainableByteBuffer.EmptyRetainableByteBuffer, RetainableByteBuffer.FixedCapacity, RetainableByteBuffer.Mutable, RetainableByteBuffer.NonRetainableByteBuffer, RetainableByteBuffer.Pooled, RetainableByteBuffer.Wrapper
-
Field Summary
Fields inherited from interface org.eclipse.jetty.io.Content.Chunk
EMPTY, EOF
Fields inherited from interface org.eclipse.jetty.io.Retainable
NON_RETAINABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the wrapped, notnull
,ByteBuffer
.slice
(long length) Get a partial slice of the buffer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.io.Content.Chunk
asReadOnly, getFailure, isLast
Methods inherited from interface org.eclipse.jetty.io.Retainable
canRetain, getRetained, isRetained, release, retain
Methods inherited from interface org.eclipse.jetty.io.RetainableByteBuffer
appendTo, appendTo, asMutable, capacity, clear, copy, get, get, get, hasRemaining, isDirect, isEmpty, isFull, isMutable, limit, maxSize, putTo, remaining, size, skip, slice, space, take, take, takeByteArray, takeFrom, toDetailString, writeTo, writeTo
-
Constructor Details
-
Empty
protected Empty()
-
-
Method Details
-
getByteBuffer
Description copied from interface:RetainableByteBuffer
Get the wrapped, notnull
,ByteBuffer
.If the implementation contains multiple buffers, they are coalesced to a single buffer before being returned. If the content is too large for a single
ByteBuffer
, then the content should be access withRetainableByteBuffer.writeTo(Content.Sink, boolean)
.- Specified by:
getByteBuffer
in interfaceRetainableByteBuffer
- Returns:
- the wrapped, not
null
,ByteBuffer
-
slice
Description copied from interface:RetainableByteBuffer
Get a partial slice of the buffer. This is equivalent toRetainableByteBuffer.slice()
.RetainableByteBuffer.limit(long)
, but may be implemented more efficiently.- Specified by:
slice
in interfaceRetainableByteBuffer
- Parameters:
length
- The number of bytes to slice, which may beyond the limit and less than the capacity, in which case it will ensure some spare capacity in the slice.- Returns:
- A sliced
RetainableByteBuffer
sharing the firstlength
bytes of this buffers data and reference count, but with independent position. The buffer isretained
by this call.
-