Package fr.gouv.vitam.common.server.application

# Class VitamStreamingOutput

java.lang.Object
fr.gouv.vitam.common.server.application.VitamStreamingOutput

All Implemented Interfaces:
  `VitamAutoCloseable`, `jakarta.ws.rs.core.StreamingOutput`, `AutoCloseable`

public class VitamStreamingOutput extends Object implements jakarta.ws.rs.core.StreamingOutput, VitamAutoCloseable
Helper for Streaming to output one InputStream or File in non async mode

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VitamStreamingOutput(File file, boolean toDelete)`
  `VitamStreamingOutput(InputStream inputStream)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `void`
  `write(OutputStream output)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VitamStreamingOutput

    public VitamStreamingOutput(InputStream inputStream)
    Parameters:
      `inputStream` - the inputstream to forward without Async mode

  - ### VitamStreamingOutput

    public VitamStreamingOutput(File file, boolean toDelete)
    Parameters:
      `file` - the file to output
      `toDelete` - If True, will delete the file once sent

- ## Method Details

  - ### write

    public void write(OutputStream output) throws IOException
    Specified by:
      `write` in interface `jakarta.ws.rs.core.StreamingOutput`
    Throws:
      `IOException`

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `VitamAutoCloseable`