package org.jboss.shrinkwrap.api.asset;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

Implementation of a Asset having empty content.
Author:Dan Allen
Version:$Revision: $
/** * Implementation of a {@link Asset} having empty content. * * @author <a href="mailto:dan.j.allen@gmail.com">Dan Allen</a> * @version $Revision: $ */
public enum EmptyAsset implements Asset { INSTANCE;
Empty contents
/** * Empty contents */
final byte[] content = new byte[0]; // -------------------------------------------------------------------------------------|| // Required Implementations -----------------------------------------------------------|| // -------------------------------------------------------------------------------------||
See Also:
  • openStream.openStream()
/** * @see org.jboss.shrinkwrap.api.asset.Asset#openStream() */
@Override public InputStream openStream() { return new ByteArrayInputStream(content); }
Returns the underlying content.
/** * Returns the underlying content. * */
public byte[] getSource() { return content; }
{@inheritDoc}
See Also:
/** * {@inheritDoc} * * @see java.lang.Object#toString() */
@Override public String toString() { return "EmptyAsset"; } }