Class GridFSDownloadStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    @NotThreadSafe
    @Deprecated(since="2021-05-27")
    public abstract class GridFSDownloadStream
    extends java.io.InputStream
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    A GridFS InputStream for downloading data from GridFS

    Provides the GridFSFile for the file to being downloaded as well as the read methods of a InputStream

    This implementation of a InputStream will not throw IOExceptions. However, it will throw a MongoException if there is an error reading from MongoDB.

    Since:
    3.1
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      abstract int available()
      Deprecated.
       
      abstract GridFSDownloadStream batchSize​(int batchSize)
      Deprecated.
      Sets the number of chunks to return per batch.
      abstract void close()
      Deprecated.
       
      abstract GridFSFile getGridFSFile()
      Deprecated.
      Gets the corresponding GridFSFile for the file being downloaded
      abstract void mark()
      Deprecated.
      Marks the current position in this input stream.
      abstract int read()
      Deprecated.
       
      abstract int read​(byte[] b)
      Deprecated.
       
      abstract int read​(byte[] b, int off, int len)
      Deprecated.
       
      abstract void reset()
      Deprecated.
       
      abstract long skip​(long n)
      Deprecated.
       
      • Methods inherited from class java.io.InputStream

        mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

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

      • GridFSDownloadStream

        public GridFSDownloadStream()
        Deprecated.
    • Method Detail

      • getGridFSFile

        public abstract GridFSFile getGridFSFile()
        Deprecated.
        Gets the corresponding GridFSFile for the file being downloaded
        Returns:
        the corresponding GridFSFile for the file being downloaded
      • batchSize

        public abstract GridFSDownloadStream batchSize​(int batchSize)
        Deprecated.
        Sets the number of chunks to return per batch.

        Can be used to control the memory consumption of this InputStream. The smaller the batchSize the lower the memory consumption and higher latency.

        Parameters:
        batchSize - the batch size
        Returns:
        this
      • read

        public abstract int read()
        Deprecated.
        Specified by:
        read in class java.io.InputStream
      • read

        public abstract int read​(byte[] b)
        Deprecated.
        Overrides:
        read in class java.io.InputStream
      • read

        public abstract int read​(byte[] b,
                                 int off,
                                 int len)
        Deprecated.
        Overrides:
        read in class java.io.InputStream
      • skip

        public abstract long skip​(long n)
        Deprecated.
        Overrides:
        skip in class java.io.InputStream
      • available

        public abstract int available()
        Deprecated.
        Overrides:
        available in class java.io.InputStream
      • mark

        public abstract void mark()
        Deprecated.
        Marks the current position in this input stream.

        A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes.

      • reset

        public abstract void reset()
        Deprecated.
        Overrides:
        reset in class java.io.InputStream
      • close

        public abstract void close()
        Deprecated.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream