Class MCRByteContent

java.lang.Object
org.mycore.common.content.MCRContent
org.mycore.common.content.MCRByteContent

public class MCRByteContent extends MCRContent
Reads MCRContent from a byte[] array.
Author:
Frank Lützenkichen
  • Constructor Details

    • MCRByteContent

      public MCRByteContent(byte[] bytes)
    • MCRByteContent

      public MCRByteContent(byte[] bytes, int offset, int length)
    • MCRByteContent

      public MCRByteContent(byte[] bytes, long lastModified)
    • MCRByteContent

      public MCRByteContent(byte[] bytes, int offset, int length, long lastModified)
  • Method Details

    • setSystemId

      public void setSystemId(String systemId)
    • getInputStream

      public InputStream getInputStream()
      Description copied from class: MCRContent
      Returns content as input stream. Be sure to close this stream properly!
      Specified by:
      getInputStream in class MCRContent
      Returns:
      input stream to read content from
    • asByteArray

      public byte[] asByteArray()
      Description copied from class: MCRContent
      Returns the raw content
      Overrides:
      asByteArray in class MCRContent
      Returns:
      the content
    • length

      public long length()
      Description copied from class: MCRContent
      Return the length of this content.
      Overrides:
      length in class MCRContent
      Returns:
      -1 if length is unknown
    • lastModified

      public long lastModified()
      Description copied from class: MCRContent
      Returns the last modified time
      Overrides:
      lastModified in class MCRContent
      Returns:
      -1 if last modified time is unknown
    • getETag

      public String getETag()
      Description copied from class: MCRContent
      Returns either strong or weak ETag.
      Overrides:
      getETag in class MCRContent
      Returns:
      null, if no ETag could be generated