public class ByteArrayResource extends BaseDataResource<byte[]>
IResource for byte arrays. The byte array can be static - passed to the constructor,
or dynamic - by overriding
BaseDataResource.getData(org.apache.wicket.request.resource.IResource.Attributes)AbstractResource.ResourceResponse, AbstractResource.WriteCallbackIResource.AttributesINTERNAL_HEADERS| Constructor and Description |
|---|
ByteArrayResource(String contentType)
Creates a
ByteArrayResource which will provide its data dynamically with
BaseDataResource.getData(org.apache.wicket.request.resource.IResource.Attributes) |
ByteArrayResource(String contentType,
byte[] array)
Creates a Resource from the given byte array with its content type
|
ByteArrayResource(String contentType,
byte[] array,
String filename)
Creates a Resource from the given byte array with its content type
|
| Modifier and Type | Method and Description |
|---|---|
protected Long |
getLength(byte[] data) |
protected void |
writeData(Response response,
byte[] data)
Writes the given data to the response
|
configureResponse, getData, newResourceResponseconfigureCache, getCachingStrategy, respond, setResponseHeaderspublic ByteArrayResource(String contentType)
ByteArrayResource which will provide its data dynamically with
BaseDataResource.getData(org.apache.wicket.request.resource.IResource.Attributes)contentType - The Content type of the array.public ByteArrayResource(String contentType, byte[] array)
contentType - The Content type of the array.array - The binary contentpublic ByteArrayResource(String contentType, byte[] array, String filename)
contentType - The Content type of the array.array - The binary contentfilename - The filename that will be set as the Content-Disposition header.protected void writeData(Response response, byte[] data)
BaseDataResourcewriteData in class BaseDataResource<byte[]>response - The response to write todata - The data to writeprotected Long getLength(byte[] data)
getLength in class BaseDataResource<byte[]>data - The data to be writtenCopyright © 2006–2014 Apache Software Foundation. All rights reserved.