Package org.glassfish.jersey.client
Interface ChunkParser
-
public interface ChunkParserChunk data parser. Implementations of this interface are used by aChunkedInputinstance for parsing response entity input stream into chunks.Chunk parsers are expected to read data from the response entity input stream until a non-empty data chunk is fully read and then return the chunk data back to the
ChunkedInputinstance for further processing (i.e. conversion into a specific Java type).Chunk parsers are typically expected to skip any empty chunks (the chunks that do not contain any data) or any control meta-data associated with chunks, however it is not a hard requirement to do so. The decision depends on the knowledge of which
MessageBodyReaderimplementation is selected for de-serialization of the chunk data.- Author:
- Marek Potociar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]readChunk(InputStream responseStream)Invoked byChunkedInputto get the data for the next chunk.
-
-
-
Method Detail
-
readChunk
byte[] readChunk(InputStream responseStream) throws IOException
Invoked byChunkedInputto get the data for the next chunk.- Parameters:
responseStream- response entity input stream.- Returns:
- next chunk data represented as an array of bytes, or
nullif no more chunks are available. - Throws:
IOException- in case reading from the response entity fails.
-
-