Package org.apache.cxf.jaxrs.provider
Class BinaryDataProvider<T>
- java.lang.Object
-
- org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
-
- org.apache.cxf.jaxrs.provider.BinaryDataProvider<T>
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>
,javax.ws.rs.ext.MessageBodyWriter<T>
public class BinaryDataProvider<T> extends AbstractConfigurableProvider implements javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>
-
-
Field Summary
-
Fields inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
BUNDLE
-
-
Constructor Summary
Constructors Constructor Description BinaryDataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
copyInputToOutput(InputStream is, OutputStream os, Annotation[] anns, javax.ws.rs.core.MultivaluedMap<String,Object> outHeaders)
protected void
copyUsingNio(InputStream is, OutputStream os, org.apache.cxf.continuations.Continuation cont)
protected NioWriteHandler
getNioHandler(InputStream in)
long
getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
protected void
handleRangeRequest(InputStream is, OutputStream os, javax.ws.rs.core.HttpHeaders inHeaders, javax.ws.rs.core.MultivaluedMap<String,Object> outHeaders)
protected boolean
isRangeSupported()
boolean
isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
boolean
isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
T
readFrom(Class<T> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType type, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is)
void
setBufferSize(int bufferSize)
void
setCloseResponseInputStream(boolean closeResponseInputStream)
void
setReportByteArraySize(boolean report)
void
writeTo(T o, Class<?> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType type, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os)
-
Methods inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
getBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, init, isPayloadEmpty, isPayloadEmpty, reportEmptyContentLength, setBus, setConsumeMediaTypes, setEnableBuffering, setEnableStreaming, setProduceMediaTypes
-
-
-
-
Method Detail
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
- Specified by:
isReadable
in interfacejavax.ws.rs.ext.MessageBodyReader<T>
-
readFrom
public T readFrom(Class<T> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType type, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is) throws IOException
- Specified by:
readFrom
in interfacejavax.ws.rs.ext.MessageBodyReader<T>
- Throws:
IOException
-
getSize
public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
- Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<T>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
- Specified by:
isWriteable
in interfacejavax.ws.rs.ext.MessageBodyWriter<T>
-
writeTo
public void writeTo(T o, Class<?> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType type, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os) throws IOException
- Specified by:
writeTo
in interfacejavax.ws.rs.ext.MessageBodyWriter<T>
- Throws:
IOException
-
copyInputToOutput
protected void copyInputToOutput(InputStream is, OutputStream os, Annotation[] anns, javax.ws.rs.core.MultivaluedMap<String,Object> outHeaders) throws IOException
- Throws:
IOException
-
copyUsingNio
protected void copyUsingNio(InputStream is, OutputStream os, org.apache.cxf.continuations.Continuation cont)
-
handleRangeRequest
protected void handleRangeRequest(InputStream is, OutputStream os, javax.ws.rs.core.HttpHeaders inHeaders, javax.ws.rs.core.MultivaluedMap<String,Object> outHeaders) throws IOException
- Throws:
IOException
-
isRangeSupported
protected boolean isRangeSupported()
-
setReportByteArraySize
public void setReportByteArraySize(boolean report)
-
setCloseResponseInputStream
public void setCloseResponseInputStream(boolean closeResponseInputStream)
-
setBufferSize
public void setBufferSize(int bufferSize)
-
getNioHandler
protected NioWriteHandler getNioHandler(InputStream in)
-
-