play.mvc.results

## Class RenderBinary

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - play.utils.FastRuntimeException
        - - play.mvc.results.Result
          - - play.mvc.results.RenderBinary

- All Implemented Interfaces:
    java.io.Serializable

      public class RenderBinary
      extends Result

  200 OK with application/octet-stream
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RenderBinary(java.io.File file)` Send a file as the response.
    `RenderBinary(java.io.File file, java.lang.String name)` Send a file as the response.
    `RenderBinary(java.io.File file, java.lang.String name, boolean inline)` Send a file as the response.
    `RenderBinary(java.io.InputStream is, java.lang.String name)` Send a binary stream as the response
    `RenderBinary(java.io.InputStream is, java.lang.String name, boolean inline)` Send a binary stream as the response
    `RenderBinary(java.io.InputStream is, java.lang.String name, long length)`
    `RenderBinary(java.io.InputStream is, java.lang.String name, long length, boolean inline)`
    `RenderBinary(java.io.InputStream is, java.lang.String name, long length, java.lang.String contentType, boolean inline)`
    `RenderBinary(java.io.InputStream is, java.lang.String name, java.lang.String contentType, boolean inline)` Send a binary stream as the response

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `apply(Http.Request request, Http.Response response)`
    `java.lang.String` | `getContentType()`
    `java.io.File` | `getFile()`
    `long` | `getLength()`
    `java.lang.String` | `getName()`
    `boolean` | `isInline()`

    - ### Methods inherited from class play.mvc.results.Result

      `getEncoding, setContentTypeIfNotSet`

    - ### Methods inherited from class play.utils.FastRuntimeException

      `fillInStackTrace`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

- - ### Constructor Detail

    - #### RenderBinary

          public RenderBinary(java.io.InputStream is,
                              java.lang.String name)

      Send a binary stream as the response
      Parameters:
        `is` - the stream to read from
        `name` - the name to use as Content-Disposition attachment filename

    - #### RenderBinary

          public RenderBinary(java.io.InputStream is,
                              java.lang.String name,
                              long length)

    - #### RenderBinary

          public RenderBinary(java.io.InputStream is,
                              java.lang.String name,
                              boolean inline)

      Send a binary stream as the response
      Parameters:
        `is` - the stream to read from
        `name` - the name to use as Content-Disposition attachment filename
        `inline` - true to set the response Content-Disposition to inline

    - #### RenderBinary

          public RenderBinary(java.io.InputStream is,
                              java.lang.String name,
                              java.lang.String contentType,
                              boolean inline)

      Send a binary stream as the response
      Parameters:
        `is` - the stream to read from
        `name` - the name to use as Content-Disposition attachment filename
        `contentType` - The content type of the stream
        `inline` - true to set the response Content-Disposition to inline

    - #### RenderBinary

          public RenderBinary(java.io.InputStream is,
                              java.lang.String name,
                              long length,
                              java.lang.String contentType,
                              boolean inline)

    - #### RenderBinary

          public RenderBinary(java.io.InputStream is,
                              java.lang.String name,
                              long length,
                              boolean inline)

    - #### RenderBinary

          public RenderBinary(java.io.File file,
                              java.lang.String name)

      Send a file as the response. Content-disposition is set to attachment.
      Parameters:
        `file` - readable file to send back
        `name` - a name to use as Content-disposition's filename

    - #### RenderBinary

          public RenderBinary(java.io.File file)

      Send a file as the response. Content-disposition is set to attachment, name is taken from file's name
      Parameters:
        `file` - readable file to send back

    - #### RenderBinary

          public RenderBinary(java.io.File file,
                              java.lang.String name,
                              boolean inline)

      Send a file as the response. Content-disposition is set to attachment, name is taken from file's name
      Parameters:
        `file` - readable file to send back
        `name` - a name to use as Content-disposition's filename
        `inline` - true to set the response Content-Disposition to inline

  - ### Method Detail

    - #### apply

          public void apply(Http.Request request,
                            Http.Response response)

      Specified by:
        `apply` in class `Result`

    - #### isInline

          public boolean isInline()

    - #### getLength

          public long getLength()

    - #### getFile

          public java.io.File getFile()

    - #### getName

          public java.lang.String getName()

    - #### getContentType

          public java.lang.String getContentType()

Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly