- java.lang.Object
-
- org.eclipse.jetty.server.HttpInput.Content
-
- org.eclipse.jetty.server.HttpInput.SpecialContent
-
- All Implemented Interfaces:
org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.thread.Invocable
- Direct Known Subclasses:
HttpInput.EofContent,HttpInput.ErrorContent
- Enclosing class:
- HttpInput
public abstract static class HttpInput.SpecialContent extends HttpInput.Content
Abstract class that implements the standard special content behavior.
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.server.HttpInput.Content
_content
-
-
Constructor Summary
Constructors Constructor Description SpecialContent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intget(byte[] buffer, int offset, int length)Read the wrapped byte buffer.java.nio.ByteBuffergetByteBuffer()Get the wrapped byte buffer.booleanhasContent()Check if there is at least one byte left in the buffer.booleanisEmpty()Check if the buffer is empty.booleanisSpecial()Check if the content is special.intremaining()Get the number of bytes remaining in the buffer.intskip(int length)Skip some bytes from the buffer.-
Methods inherited from class org.eclipse.jetty.server.HttpInput.Content
getError, getInvocationType, isEof, toString
-
-
-
-
Method Detail
-
getByteBuffer
public final java.nio.ByteBuffer getByteBuffer()
Description copied from class:HttpInput.ContentGet the wrapped byte buffer. ThrowsIllegalStateExceptionif the content is special.- Overrides:
getByteBufferin classHttpInput.Content- Returns:
- the wrapped byte buffer.
-
get
public final int get(byte[] buffer, int offset, int length)Description copied from class:HttpInput.ContentRead the wrapped byte buffer. ThrowsIllegalStateExceptionif the content is special.- Overrides:
getin classHttpInput.Content- Parameters:
buffer- The array into which bytes are to be written.offset- The offset within the array of the first byte to be written.length- The maximum number of bytes to be written to the given array.- Returns:
- The amount of bytes read from the buffer.
-
skip
public final int skip(int length)
Description copied from class:HttpInput.ContentSkip some bytes from the buffer. Has no effect on a special content.- Overrides:
skipin classHttpInput.Content- Parameters:
length- How many bytes to skip.- Returns:
- How many bytes were skipped.
-
hasContent
public final boolean hasContent()
Description copied from class:HttpInput.ContentCheck if there is at least one byte left in the buffer. Always false on a special content.- Overrides:
hasContentin classHttpInput.Content- Returns:
- true if there is at least one byte left in the buffer.
-
remaining
public final int remaining()
Description copied from class:HttpInput.ContentGet the number of bytes remaining in the buffer. Always 0 on a special content.- Overrides:
remainingin classHttpInput.Content- Returns:
- the number of bytes remaining in the buffer.
-
isEmpty
public final boolean isEmpty()
Description copied from class:HttpInput.ContentCheck if the buffer is empty. Always true on a special content.- Overrides:
isEmptyin classHttpInput.Content- Returns:
- true if there is 0 byte left in the buffer.
-
isSpecial
public final boolean isSpecial()
Description copied from class:HttpInput.ContentCheck if the content is special.- Overrides:
isSpecialin classHttpInput.Content- Returns:
- true if the content is special, false otherwise.
-
-