Class ContentStreamBase.ByteArrayStream

    • Constructor Detail

      • ByteArrayStream

        public ByteArrayStream​(byte[] bytes,
                               String source)
      • ByteArrayStream

        public ByteArrayStream​(byte[] bytes,
                               String source,
                               String contentType)
    • Method Detail

      • getStream

        public InputStream getStream()
                              throws IOException
        Description copied from interface: ContentStream
        Get an open stream. You are responsible for closing it. Consider using something like:
           InputStream stream = stream.getStream();
           try {
             // use the stream...
           finally {
        Only the first call to getStream() or getReader() is guaranteed to work. The runtime behavior for additional calls is undefined.

        Note: you must call getStream() or getReader() before the attributes (name, contentType, etc) are guaranteed to be set. Streams may be lazy loaded only when this method is called.