RawBuffer

play.api.mvc.RawBuffer
case class RawBuffer(memoryThreshold: Long, temporaryFileCreator: TemporaryFileCreator, initialData: ByteString)

Handle the request body a raw bytes data.

Value parameters

initialData

the initial data, ByteString.empty by default.

memoryThreshold

If the content size is bigger than this limit, the content is stored as file.

temporaryFileCreator

the temporary file creator to store the content as file.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def asBytes(maxLength: Long): Option[ByteString]

Returns the buffer content as a bytes array.

Returns the buffer content as a bytes array.

This operation will cause the internal collection of byte arrays to be copied into a new byte array on each invocation, no caching is done. If the buffer has been written out to a file, it will read the contents of the file.

Value parameters

maxLength

The max length allowed to be stored in memory. If this is smaller than memoryThreshold, and the buffer is already in memory then None will still be returned.

Attributes

Returns

None if the content is greater than maxLength, otherwise, the data as bytes.

def asFile: File

Returns the buffer content as File.

Returns the buffer content as File.

Attributes

def size: Long

Buffer size.

Buffer size.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product