public class RangeUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RangeUtils.Range |
| Modifier and Type | Field and Description |
|---|---|
static List<RangeUtils.Range> |
FULL
Full range marker.
|
static String |
MIME_SEPARATION
MIME multipart separation string
|
| Constructor and Description |
|---|
RangeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(InputStream resourceInputStream,
javax.servlet.ServletOutputStream ostream,
Iterator<RangeUtils.Range> ranges,
String contentType)
Copy the contents of the specified input stream to the specified
output stream, and ensure that both streams are closed before returning
(even in the face of an exception).
|
static void |
copy(InputStream resourceInputStream,
javax.servlet.ServletOutputStream ostream,
RangeUtils.Range range)
Copy the contents of the specified input stream to the specified
output stream, and ensure that both streams are closed before returning
(even in the face of an exception).
|
static IOException |
copyRange(InputStream istream,
javax.servlet.ServletOutputStream ostream,
long start,
long end)
Copy the contents of the specified input stream to the specified
output stream, and ensure that both streams are closed before returning
(even in the face of an exception).
|
static int |
getInputBufferSize() |
static int |
getOutput() |
static List<RangeUtils.Range> |
parseRange(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String eTag,
long lastModified,
long fileLength)
Parse the range header.
|
static void |
setInputBufferSize(int inputBufferSize) |
static void |
setOutput(int output) |
public static final List<RangeUtils.Range> FULL
public static final String MIME_SEPARATION
public static List<RangeUtils.Range> parseRange(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String eTag, long lastModified, long fileLength) throws IOException
request - The servlet request we are processingresponse - The servlet response we are creatingIOExceptionpublic static void copy(InputStream resourceInputStream, javax.servlet.ServletOutputStream ostream, RangeUtils.Range range) throws IOException
ostream - The output stream to write torange - Range the client wanted to retrieveIOException - if an input/output error occurspublic static void copy(InputStream resourceInputStream, javax.servlet.ServletOutputStream ostream, Iterator<RangeUtils.Range> ranges, String contentType) throws IOException
ostream - The output stream to write toranges - Enumeration of the ranges the client wanted to retrievecontentType - Content type of the resourceIOException - if an input/output error occurspublic static IOException copyRange(InputStream istream, javax.servlet.ServletOutputStream ostream, long start, long end)
istream - The input stream to read fromostream - The output stream to write tostart - Start of the range which will be copiedend - End of the range which will be copiedpublic static int getInputBufferSize()
public static void setInputBufferSize(int inputBufferSize)
public static int getOutput()
public static void setOutput(int output)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.