Class ByteArrayResource

    • Constructor Detail

      • 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.lang.String filename)
        Creates a Resource from the given byte array with its content type
        Parameters:
        contentType - The Content type of the array.
        array - The binary content
        filename - The filename that will be set as the Content-Disposition header.
    • Method Detail

      • writeData

        protected void writeData​(org.apache.wicket.request.Response response,
                                 byte[] data)
        Description copied from class: BaseDataResource
        Writes the given data to the response
        Specified by:
        writeData in class BaseDataResource<byte[]>
        Parameters:
        response - The response to write to
        data - The data to write
      • getLength

        protected java.lang.Long getLength​(byte[] data)
        Specified by:
        getLength in class BaseDataResource<byte[]>
        Parameters:
        data - The data to be written
        Returns:
        The length of the data to be written. Used to set "Content-Length" response header