|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.ws.rs.core.GenericType<T>
org.glassfish.jersey.client.ChunkedInput<T>
T - chunk type.public class ChunkedInput<T>
Response entity type used for receiving messages in "typed" chunks. This data type is useful for consuming partial responses from large or continuous data input streams.
| Method Summary | |
|---|---|
void |
close()
|
static ChunkParser |
createParser(byte[] boundary)
Create new chunk parser that will split the response entity input stream based on a fixed boundary sequence of bytes. |
static ChunkParser |
createParser(java.lang.String boundary)
Create new chunk parser that will split the response entity input stream based on a fixed boundary string. |
MediaType |
getChunkType()
Get chunk data media type. |
ChunkParser |
getParser()
Get the underlying chunk parser. |
boolean |
isClosed()
Check if the chunked input has been closed. |
T |
read()
Read next chunk from the response stream and convert it to a Java instance using the chunk media type. |
void |
setChunkType(MediaType mediaType)
Set custom chunk data media type. |
void |
setChunkType(java.lang.String mediaType)
Set custom chunk data media type from a string value. |
void |
setParser(ChunkParser parser)
Set new chunk parser. |
| Methods inherited from class javax.ws.rs.core.GenericType |
|---|
equals, getRawType, getType, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static ChunkParser createParser(java.lang.String boundary)
boundary - chunk boundary.
public static ChunkParser createParser(byte[] boundary)
boundary - chunk boundary.
public ChunkParser getParser()
Note: Access to internal chunk parser is not a thread-safe operation and has to be explicitly synchronized in case the chunked input is used from multiple threads.
public void setParser(ChunkParser parser)
Note: Access to internal chunk parser is not a thread-safe operation and has to be explicitly synchronized in case the chunked input is used from multiple threads.
parser - new chunk parser.public MediaType getChunkType()
"Content-Type" header field.
This default value may be manually overridden by setting
a custom non-null chunk media type value.
Note: Access to internal chunk media type is not a thread-safe operation and has to be explicitly synchronized in case the chunked input is used from multiple threads.
public void setChunkType(MediaType mediaType)
throws java.lang.IllegalArgumentException
"Content-Type" header field.
Using this methods will override the default chunk media type value and set it
to a custom non-null chunk media type. Once this method is invoked,
all subsequent chunk reads will use the newly set chunk media
type when selecting the proper MessageBodyReader for
chunk de-serialization.
Note: Access to internal chunk media type is not a thread-safe operation and has to be explicitly synchronized in case the chunked input is used from multiple threads.
mediaType - custom chunk data media type. Must not be null.
java.lang.IllegalArgumentException - in case the mediaType is null.
public void setChunkType(java.lang.String mediaType)
throws java.lang.IllegalArgumentException
Note: Access to internal chunk media type is not a thread-safe operation and has to be explicitly synchronized in case the chunked input is used from multiple threads.
mediaType - custom chunk data media type. Must not be null.
java.lang.IllegalArgumentException - in case the mediaType cannot be parsed into
a valid MediaType instance or is null.setChunkType(javax.ws.rs.core.MediaType)public void close()
close in interface java.io.Closeablepublic boolean isClosed()
true if this chunked input has been closed, false otherwise.
public T read()
throws java.lang.IllegalStateException
chunk media type.
Note: Access to internal chunk parser is not a thread-safe operation and has to be explicitly synchronized in case the chunked input is used from multiple threads.
java.lang.IllegalStateException - in case this chunked input has been closed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||