Class MCRStreamContent

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

public class MCRStreamContent extends MCRContent
Reads MCRContent from an input stream. Typically, this content is not reusable, so that content can only be read once. Please be aware that an instance of this object contains an open input stream. Thus one has to invoke getInputStream().close() when finished with this object.
Author:
Frank Lützenkichen
  • Constructor Details

    • MCRStreamContent

      public MCRStreamContent(InputStream in)
    • MCRStreamContent

      public MCRStreamContent(InputStream in, String systemId)
      Parameters:
      systemId - the systemID of this stream
    • MCRStreamContent

      public MCRStreamContent(InputStream in, String systemId, String docType)
      Parameters:
      systemId - the systemID of this stream
  • Method Details

    • 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
    • getContentInputStream

      public MCRContentInputStream getContentInputStream() throws IOException
      Description copied from class: MCRContent
      Returns content as content input stream, which provides MD5 functionality. Be sure to close this stream properly!
      Overrides:
      getContentInputStream in class MCRContent
      Returns:
      the content input stream
      Throws:
      IOException
    • isReusable

      public boolean isReusable()
      Returns false, because input streams can only be read once. Use getReusableCopy() to circumvent this.
      Overrides:
      isReusable in class MCRContent