Interface OutboundMessageContext.StreamProvider

Enclosing class:

public static interface OutboundMessageContext.StreamProvider
The callback interface which is used to get the terminal output stream into which the entity should be written and to inform the implementation about the entity size.
  • Method Summary

    Modifier and Type
    getOutputStream(int contentLength)
    Get the output stream.
  • Method Details

    • getOutputStream

      OutputStream getOutputStream(int contentLength) throws IOException
      Get the output stream. This method will be called after all the writer interceptors are called and written entity is buffered into the buffer or the buffer exceeds.
      contentLength - the size of the buffered entity or -1 if the entity exceeded the maximum buffer size or if the buffering is disabled.
      the adapted output stream into which the serialized entity should be written. May return null which will cause ignoring the written entity (in that case the entity will still be written by message body writers but the output will be ignored).
      IOException - in case of an IO error.