1 | <?php |
||
32 | class ServletResponseWrapper implements ServletResponseInterface |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * The response instance. |
||
37 | * |
||
38 | * @var \AppserverIo\Psr\Servlet\ServletResponseInterface |
||
39 | */ |
||
40 | protected $response; |
||
41 | |||
42 | /** |
||
43 | * Injects the passed response instance into this servlet response. |
||
44 | * |
||
45 | * @param \AppserverIo\Psr\Servlet\ServletResponseInterface $response The response instance used for initialization |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | 2 | public function injectResponse(ServletResponseInterface $response) |
|
53 | |||
54 | /** |
||
55 | * Returns the response that will be send back to the client. |
||
56 | * |
||
57 | * @return \AppserverIo\Psr\Servlet\ServletResponseInterface The response instance |
||
58 | */ |
||
59 | 1 | public function getResponse() |
|
63 | |||
64 | /** |
||
65 | * Appends body stream with content. |
||
66 | * |
||
67 | * @param string $content The content to append |
||
68 | * |
||
69 | * @return integer The number of written bytes |
||
70 | */ |
||
71 | public function appendBodyStream($content) |
||
75 | |||
76 | /** |
||
77 | * Copies a source stream to body stream. |
||
78 | * |
||
79 | * @param resource $sourceStream The file pointer to source stream |
||
80 | * @param integer $maxlength The max length to read from source stream |
||
81 | * @param integer $offset The offset from source stream to read |
||
82 | * |
||
83 | * @return integer the total number of bytes copied |
||
84 | */ |
||
85 | public function copyBodyStream($sourceStream, $maxlength = null, $offset = null) |
||
89 | |||
90 | /** |
||
91 | * Returns the body stream as a resource. |
||
92 | * |
||
93 | * @return resource The body stream |
||
94 | */ |
||
95 | 1 | public function getBodyStream() |
|
99 | |||
100 | /** |
||
101 | * Returns the body content |
||
102 | * |
||
103 | * @return string $content |
||
104 | */ |
||
105 | public function getBodyContent() |
||
109 | |||
110 | /** |
||
111 | * Reset the body stream |
||
112 | * |
||
113 | * @return void |
||
114 | */ |
||
115 | public function resetBodyStream() |
||
119 | |||
120 | /** |
||
121 | * Resets the stream resource pointing to body content. |
||
122 | * |
||
123 | * @param resource $bodyStream The body content stream resource |
||
124 | * |
||
125 | * @return void |
||
126 | */ |
||
127 | public function setBodyStream($bodyStream) |
||
131 | } |
||
132 |