wicket.resource
Class ByteArrayResource
java.lang.Object
wicket.Resource
wicket.markup.html.WebResource
wicket.resource.ByteArrayResource
- All Implemented Interfaces:
- java.io.Serializable, IRequestListener, IResourceListener
public class ByteArrayResource
- extends WebResource
This class can be used to easy make a Resource from a predefined byte array.
If your data comes from a database then a DynamicWebResource is a
better choice. Only use this class if you have to have the byte array in
memory. Like a pdf that is generated on the fly.
- Author:
- Johan Compagner
- See Also:
- Serialized Form
|
Constructor Summary |
ByteArrayResource(java.lang.String contentType,
byte[] array)
Creates a Resource from the given byte array with its content type |
ByteArrayResource(java.lang.String contentType,
byte[] array,
java.util.Locale locale)
Creates a Resource from the given byte array with its content type and
the locale for which it is valid. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteArrayResource
public ByteArrayResource(java.lang.String contentType,
byte[] array)
- Creates a Resource from the given byte array with its content type
- Parameters:
contentType - The Content type of the array.array - The binary content
ByteArrayResource
public ByteArrayResource(java.lang.String contentType,
byte[] array,
java.util.Locale locale)
- Creates a Resource from the given byte array with its content type and
the locale for which it is valid.
- Parameters:
contentType - The Content type of the array.array - The binary content.locale - The locale of this resource
getResourceStream
public IResourceStream getResourceStream()
- Specified by:
getResourceStream in class Resource
- Returns:
- Gets the resource to render to the requester
- See Also:
Resource.getResourceStream()
Copyright © 2004-2007 Wicket developers. All Rights Reserved.