Package ej.rest.web
Class ChunkedContent
- java.lang.Object
-
- ej.rest.web.AbstractContent
-
- ej.rest.web.ChunkedContent
-
public class ChunkedContent extends AbstractContent
Represents a chunked, streaming content. Takes the data from InputStream and sends it.
-
-
Field Summary
-
Fields inherited from class ej.rest.web.AbstractContent
CRLF
-
-
Constructor Summary
Constructors Constructor Description ChunkedContent(String mime, InputStream in, int chunkSize)Instantiates a new chunked content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddContent(URLConnection con)voidwriteContent(OutputStream os)voidwriteHeader(OutputStream os)-
Methods inherited from class ej.rest.web.AbstractContent
ascii, enc
-
-
-
-
Constructor Detail
-
ChunkedContent
public ChunkedContent(String mime, InputStream in, int chunkSize)
Instantiates a new chunked content. If streaming mode is supported by the provided connection (HttpURLConnection), Resty will use it in streaming mode.- Parameters:
mime- the mimein- the inchunkSize- the chunk size. If chunk size is negative or 0, Resty will use its default buffer size as chunk size.
-
-
Method Detail
-
writeHeader
public void writeHeader(OutputStream os) throws IOException
- Specified by:
writeHeaderin classAbstractContent- Throws:
IOException
-
writeContent
public void writeContent(OutputStream os) throws IOException
- Specified by:
writeContentin classAbstractContent- Throws:
IOException
-
addContent
protected void addContent(URLConnection con) throws IOException
- Specified by:
addContentin classAbstractContent- Throws:
IOException
-
-