protected class ProxyServlet.ProxyInputStreamContentProvider extends InputStreamContentProvider
ContentProvider.Typed
Callback.Adapter, Callback.Nested, Callback.NonBlocking
Modifier | Constructor and Description |
---|---|
protected |
ProxyInputStreamContentProvider(HttpServletRequest request,
HttpServletResponse response,
Request proxyRequest,
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(HttpServletRequest request,
Request proxyRequest,
byte[] buffer,
int offset,
int length) |
close, failed, iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
isNonBlocking, succeeded
protected ProxyInputStreamContentProvider(HttpServletRequest request, HttpServletResponse response, Request proxyRequest, 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(HttpServletRequest request, Request proxyRequest, 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-2016 Webtide. All Rights Reserved.