Class StorageTextBody

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      StorageTextBody copy()
      Returns a copy of this SingleBody (optional operation).
      void dispose()
      Deletes the Storage that holds the content of this text body.
      java.nio.charset.Charset getCharset()  
      java.io.InputStream getInputStream()
      Gets a InputStream which reads the bytes of the body.
      java.lang.String getMimeCharset()
      Returns the MIME charset of this text body.
      java.io.Reader getReader()
      Gets a Reader which may be used to read out the contents of this body.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StorageTextBody

        public StorageTextBody​(MultiReferenceStorage storage,
                               java.nio.charset.Charset charset)
    • Method Detail

      • getMimeCharset

        public java.lang.String getMimeCharset()
        Description copied from class: TextBody
        Returns the MIME charset of this text body.
        Specified by:
        getMimeCharset in class TextBody
        Returns:
        the MIME charset.
      • getCharset

        public java.nio.charset.Charset getCharset()
        Specified by:
        getCharset in class TextBody
      • getReader

        public java.io.Reader getReader()
                                 throws java.io.IOException
        Description copied from class: TextBody
        Gets a Reader which may be used to read out the contents of this body.
        Specified by:
        getReader in class TextBody
        Returns:
        the Reader.
        Throws:
        java.io.IOException - on I/O errors.
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from class: SingleBody
        Gets a InputStream which reads the bytes of the body.
        Specified by:
        getInputStream in class SingleBody
        Returns:
        the stream, transfer decoded
        Throws:
        java.io.IOException - on I/O errors.
      • copy

        public StorageTextBody copy()
        Description copied from class: SingleBody
        Returns a copy of this SingleBody (optional operation).

        The general contract of this method is as follows:

        • Invoking SingleBody.getParent() on the copy returns null. That means that the copy is detached from the parent entity of this SingleBody. The copy may get attached to a different entity later on.
        • The underlying content does not have to be copied. Instead it may be shared between multiple copies of a SingleBody.
        • If the underlying content is shared by multiple copies the implementation has to make sure that the content gets deleted when the last copy gets disposed of (and not before that).

        This implementation always throws an UnsupportedOperationException.

        Overrides:
        copy in class SingleBody
        Returns:
        a copy of this SingleBody.