protected class ProxyServlet.ProxyInputStreamContentProvider extends InputStreamContentProvider
ContentProvider.Typed
Callback.Adapter
Modifier | Constructor and Description |
---|---|
protected |
ProxyServlet.ProxyInputStreamContentProvider(Request proxyRequest,
HttpServletRequest request,
InputStream input) |
Modifier and Type | Method and Description |
---|---|
long |
getLength() |
protected ByteBuffer |
onRead(byte[] buffer,
int offset,
int length)
Callback method invoked just after having read from the stream,
but before returning the iteration element (a
ByteBuffer
to the caller. |
protected void |
onReadFailure(Throwable failure)
Callback method invoked when an exception is thrown while reading
from the stream.
|
protected ByteBuffer |
onRequestContent(Request proxyRequest,
HttpServletRequest request,
byte[] buffer,
int offset,
int length) |
close, failed, iterator, succeeded
protected ProxyServlet.ProxyInputStreamContentProvider(Request proxyRequest, HttpServletRequest request, InputStream input)
public long getLength()
getLength
in interface ContentProvider
getLength
in class InputStreamContentProvider
protected ByteBuffer onRead(byte[] buffer, int offset, int length)
InputStreamContentProvider
ByteBuffer
to the caller.
Subclasses may override this method to copy the content read from
the stream to another location (a file, or in memory if the content
is known to fit).onRead
in class InputStreamContentProvider
buffer
- the byte array containing the bytes readoffset
- the offset from where bytes should be readlength
- the length of the bytes readByteBuffer
wrapping the byte arrayprotected ByteBuffer onRequestContent(Request proxyRequest, HttpServletRequest request, byte[] buffer, int offset, int length)
protected void onReadFailure(Throwable failure)
InputStreamContentProvider
onReadFailure
in class InputStreamContentProvider
failure
- the exception thrown while reading from the stream.Copyright © 1995-2015 Webtide. All Rights Reserved.