Class RetainableByteBuffer.EmptyRetainableByteBuffer
java.lang.Object
org.eclipse.jetty.io.RetainableByteBuffer.EmptyRetainableByteBuffer
- All Implemented Interfaces:
 Retainable, RetainableByteBuffer
- Enclosing interface:
 RetainableByteBuffer
public static class RetainableByteBuffer.EmptyRetainableByteBuffer
extends Object
implements RetainableByteBuffer
A 
RetainableByteBuffer that is empty and not retainable.- 
Nested Class Summary
Nested classes/interfaces inherited from interface Retainable
Retainable.ReferenceCounterNested classes/interfaces inherited from interface RetainableByteBuffer
RetainableByteBuffer.Abstract, RetainableByteBuffer.DynamicCapacity, RetainableByteBuffer.EmptyRetainableByteBuffer, RetainableByteBuffer.FixedCapacity, RetainableByteBuffer.Mutable, RetainableByteBuffer.NonRetainableByteBuffer, RetainableByteBuffer.Pooled, RetainableByteBuffer.Wrapper - 
Field Summary
Fields inherited from interface Retainable
NON_RETAINABLEFields inherited from interface RetainableByteBuffer
EMPTY - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidclear()copy()Creates a deep copy of this RetainableByteBuffer that is entirely independentGet the wrapped, notnull,ByteBuffer.booleanCheck if the underlying implementation is mutable.slice()Get a slice of the buffer.slice(long length) Get a partial slice of the buffer.take()Take the contents of this buffer, leaving it clear.byte[]Take the contents of this buffer, leaving it clear and independent.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Retainable
canRetain, getRetained, isRetained, release, retain 
- 
Constructor Details
- 
EmptyRetainableByteBuffer
public EmptyRetainableByteBuffer() 
 - 
 - 
Method Details
- 
getByteBuffer
Description copied from interface:RetainableByteBufferGet 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:
 getByteBufferin interfaceRetainableByteBuffer- Returns:
 - the wrapped, not 
null,ByteBuffer 
 - 
isMutable
public boolean isMutable()Description copied from interface:RetainableByteBufferCheck if the underlying implementation is mutable. Note that the immutableRetainableByteBufferAPI may be backed by a mutableByteBufferor theRetainableByteBuffer.MutableAPI may be backed by an immutableByteBuffer.- Specified by:
 isMutablein interfaceRetainableByteBuffer- Returns:
 - whether this buffers implementation is mutable
 - See Also:
 
 - 
copy
Description copied from interface:RetainableByteBufferCreates a deep copy of this RetainableByteBuffer that is entirely independent- Specified by:
 copyin interfaceRetainableByteBuffer- Returns:
 - A copy of this RetainableByteBuffer
 
 - 
clear
public void clear()- Specified by:
 clearin interfaceRetainableByteBuffer- See Also:
 
 - 
slice
Description copied from interface:RetainableByteBufferGet a slice of the buffer.- Specified by:
 slicein interfaceRetainableByteBuffer- Returns:
 - A sliced 
RetainableByteBuffersharing this buffers data and reference count, but with independent position. The buffer isretainedby this call. - See Also:
 
 - 
slice
Description copied from interface:RetainableByteBufferGet a partial slice of the buffer. This is equivalent toRetainableByteBuffer.slice().RetainableByteBuffer.limit(long), but may be implemented more efficiently.- Specified by:
 slicein 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 
RetainableByteBuffersharing the firstlengthbytes of this buffers data and reference count, but with independent position. The buffer isretainedby this call. 
 - 
take
Description copied from interface:RetainableByteBufferTake the contents of this buffer, leaving it clear.- Specified by:
 takein interfaceRetainableByteBuffer- Returns:
 - A buffer with the contents of this buffer, avoiding copies if possible.
 - See Also:
 
 - 
takeByteArray
public byte[] takeByteArray()Description copied from interface:RetainableByteBufferTake the contents of this buffer, leaving it clear and independent.- Specified by:
 takeByteArrayin interfaceRetainableByteBuffer- Returns:
 - A possibly newly allocated array with the contents of this buffer, avoiding copies if possible.
 
 - 
toDetailString
- Specified by:
 toDetailStringin interfaceRetainableByteBuffer- Returns:
 - A string showing the info and detail about this buffer, as well as a summary of the contents
 
 
 -