Class PartWriterCallback

    • Constructor Detail

      • PartWriterCallback

        public PartWriterCallback​(InputStream inputStream,
                                  Long contentLength,
                                  Long startbyte,
                                  Long endbyte)
        Creates a part writer callback.

        Reads a part of the given input stream. If the startbyte parameter is not null the number of bytes are skipped till the stream is read. If the endbyte is not null the stream is read till endbyte, else to the end of the whole stream. If startbyte and endbyte is null the whole stream is copied.
        Parameters:
        inputStream - the input stream to read from
        contentLength - content length of the input stream. Ignored if endByte is specified
        startbyte - the start position to read from (if not null the number of bytes are skipped till the stream is read)
        endbyte - the end position to read to (if not null the stream is going to be read till endbyte, else to the end of the whole stream)
    • Method Detail

      • getBufferSize

        public int getBufferSize()
        Sets the buffer size used to send the data to the client
        Returns:
        the buffer size used to send the data to the client (default is 4096)
      • setBufferSize

        public PartWriterCallback setBufferSize​(int bufferSize)
        Sets the buffer size used to send the data to the client
        Parameters:
        bufferSize - the buffer size used to send the data to the client
        Returns:
        the part writer callback
      • isClose

        public boolean isClose()
        If the given input stream is going to be closed
        Returns:
        if the given input stream is going to be closed
      • setClose

        public PartWriterCallback setClose​(boolean close)
        If set true the given input stream is going to be closed
        Parameters:
        close - if the given input stream is going to be closed
        Returns:
        the part writer callback