Package org.eclipse.jetty.server
Class HttpInput.SpecialContent
java.lang.Object
org.eclipse.jetty.server.HttpInput.Content
org.eclipse.jetty.server.HttpInput.SpecialContent
- Direct Known Subclasses:
- HttpInput.EofContent,- HttpInput.ErrorContent
- Enclosing class:
- HttpInput
Abstract class that implements the standard special content behavior.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.eclipse.jetty.util.CallbackCallback.Completable, Callback.Completing, Callback.NestedNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.InvocableInvocable.InvocationType, Invocable.ReadyTask, Invocable.Task
- 
Field SummaryFields inherited from class org.eclipse.jetty.server.HttpInput.Content_contentFields inherited from interface org.eclipse.jetty.util.thread.Invocable__nonBlocking
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal intget(byte[] buffer, int offset, int length) Read the wrapped byte buffer.final ByteBufferGet the wrapped byte buffer.final booleanCheck if there is at least one byte left in the buffer.final booleanisEmpty()Check if the buffer is empty.final booleanCheck if the content is special.final intGet the number of bytes remaining in the buffer.final intskip(int length) Skip some bytes from the buffer.Methods inherited from class org.eclipse.jetty.server.HttpInput.ContentgetError, getInvocationType, isEof, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.CallbackcompleteWith, failed, succeeded
- 
Constructor Details- 
SpecialContentpublic SpecialContent()
 
- 
- 
Method Details- 
getByteBufferDescription copied from class:HttpInput.ContentGet the wrapped byte buffer. ThrowsIllegalStateExceptionif the content is special.- Overrides:
- getByteBufferin class- HttpInput.Content
- Returns:
- the wrapped byte buffer.
 
- 
getpublic 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 class- HttpInput.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.
 
- 
skippublic 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 class- HttpInput.Content
- Parameters:
- length- How many bytes to skip.
- Returns:
- How many bytes were skipped.
 
- 
hasContentpublic 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 class- HttpInput.Content
- Returns:
- true if there is at least one byte left in the buffer.
 
- 
remainingpublic 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 class- HttpInput.Content
- Returns:
- the number of bytes remaining in the buffer.
 
- 
isEmptypublic final boolean isEmpty()Description copied from class:HttpInput.ContentCheck if the buffer is empty. Always true on a special content.- Overrides:
- isEmptyin class- HttpInput.Content
- Returns:
- true if there is 0 byte left in the buffer.
 
- 
isSpecialpublic final boolean isSpecial()Description copied from class:HttpInput.ContentCheck if the content is special. A content is deemed special if it does not hold bytes but rather conveys a special event, like when EOF has been reached or an error has occurred.- Overrides:
- isSpecialin class- HttpInput.Content
- Returns:
- true if the content is special, false otherwise.
 
 
-