Out
Response feature to HTTP requests.
close
_out.close() : Out
Description
Closes the sending of HTTP response data.
Return
( Out )
closed
_out.closed() : boolean
Description
Checks whether the response to the HTTP request has already been closed.
Return
( boolean )
The response to the HTTP request has been closed.
copy
_out.copy(in: InputStream) : Out
Description
Copies all data from an InputStream to Proteu's standard output (OutputStream), starting from the beginning of the input stream.
It is a straightforward utility method, ideal for complete transfers of binary content (such as files, images, etc.), without the need to manipulate positions or limits.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| in | InputStream | Input stream from which data will be read and transferred to the output. |
Return
( Out )
Returns the Out object itself
_out.copy(in: InputStream, skip: long) : Out
Description
Copies data from an InputStream to the current output (Proteu OutputStream), optionally skipping the first bytes specified by skip.
This method is a simplified version of the copy method with limited size, useful for transferring entire data streams, starting from a specific position.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| in | InputStream | The input stream from which data will be read. |
| skip | long | Number of bytes to skip before starting the copy. Use 0 to start from the beginning. |
Return
( Out )
Returns the Out object itself
_out.copy(in: InputStream, skip: long, size: long) : Out
Description
Copies data from an InputStream to the current output (OutputStream associated with Out), with optional support for skipping bytes and limiting the total size copied.
This method is useful for efficient transfers of binary streams, with precise control over the starting point and volume of data.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| in | InputStream | The input stream from which the data will be read. |
| skip | long | Number of bytes to skip before starting the copy (use 0 to skip none). |
| size | long | Maximum number of bytes to copy (use -1 to copy to the end of the stream). |
Return
( Out )
Returns the Out object itself
_out.copy(file: File) : Out
Description
Copies all content from a file to the response output (OutputStream).
This method is a convenience that encapsulates the creation of an InputStream from a File, and delegates the copy operation to the copy(InputStream in) method.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| file | File | The file from which the data will be copied. |
Return
( Out )
Returns the Out object itself
_out.copy(file: File, skip: long) : Out
Description
Copies data from a file to the response output (OutputStream), skipping an initial number of bytes.
This method is a convenience that abstracts the creation of an InputStream from a File and delegates the logic to the copy(InputStream in, long skip) method.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| file | File | The file from which the data will be copied. |
| skip | long | Number of bytes to be skipped at the beginning of the file. |
Return
( Out )
Returns the Out object itself
_out.copy(file: File, skip: long, size: long) : Out
Description
Copies a range of data from a file to the output (OutputStream) of the Proteu instance.
This method is a convenience that encapsulates opening the InputStream of the file and delegates the operation to the copy(InputStream, long, long) method.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| file | File | The file from which the data will be copied. |
| skip | long | Number of bytes to be skipped at the beginning of the file. |
| size | long | Number of bytes to be copied after the skip. If size is negative (< 0), all remaining content will be copied. |
Return
( Out )
Returns the Out object itself
_out.copy(storage: Storage) : Out
Description
Copies all content from a Storage resource to the current output, without skipping bytes at the beginning and without a size limit.
This method is a simplified way of calling copy(Storage storage, long skip, long size) with the skip and size parameters set to -1, indicating that there is no initial skip and all content should be copied.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| storage | Storage | The storage resource representing the file to be copied. |
Return
( Out )
Returns the Out object itself
_out.copy(storage: Storage, skip: long) : Out
Description
Copies data from a Storage resource to the current output, starting reading after skipping a specified number of bytes (skip).
This method is a convenient way to call copy(Storage storage, long skip, long size) with size set to -1, i.e., no size limit — copying all remaining content after skip.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| storage | Storage | The storage resource representing the file to be copied. |
| skip | long | Number of bytes to be skipped at the beginning of the file. |
Return
( Out )
Returns the Out object itself
_out.copy(storage: Storage, skip: long, size: long) : Out
Description
Copies the entire contents of a file to the response output (OutputStream).
This method is a convenience that encapsulates the creation of an InputStream from a file and delegates the copy operation to the copy(InputStream in) method.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| storage | Storage | The storage resource representing the file to be copied. |
| skip | long | Number of bytes to be skipped at the beginning of the file. |
| size | long | Maximum number of bytes to copy after the skip |
Return
( Out )
Returns the Out object itself
flush
_out.flush() : void
Description
Sends what is pending accumulated in the buffer.
Return
( void )
getJSONHTMLEscape
_out.getJSONHTMLEscape() : boolean
Description
Returns the current state of HTML escape configuration in the JSON response.
This method is equivalent to jsonHTMLEscape() and is present to maintain consistency with JavaBeans-based naming conventions (use of get as a prefix).
Return
( boolean )
Returns true if HTML escaping is enabled, otherwise returns false.
getJSONIndentFactor
_out.getJSONIndentFactor() : int
Description
Auxiliary method that returns the same value as jsonIdentFactor(), maintaining compatibility with JavaBeans-style naming conventions.
Return
( int )
Returns the value of the JSON indentation factor.
getMirrors
_out.getMirrors() : java.util.List<OutputStream>
Description
Gets the output replicas.
Return
( java.util.List )
List of replicas.
init
_out.init() : Out
Description
Starts a new instance of output.
Return
( Out )
The new instance of the Output feature.
isClosed
_out.isClosed() : boolean
Return
( boolean )
isStarted
_out.isStarted() : boolean
Return
( boolean )
json
_out.json(Values: java.lang.Object) : Out
Description
Sends a response in JSON format to the client. This method sets the appropriate headers to ensure that the response is not cached and that the content is treated as valid JSON.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| Values | java.lang.Object | Object of type Values that will be converted into text and sent as JSON. |
Return
( Out )
Returns the Out object itself
_out.json(String: string) : Out
Description
Sends a response in JSON format to the client. This method sets the appropriate headers to ensure that the response is not cached and that the content is treated as valid JSON.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| String | string | Text in JSON format to be sent as a response. |
Return
( Out )
Returns the Out object itself
_out.json(Values: java.util.List<Values>) : Out
Description
Generates a formatted JSON response from an array of objects. The content is automatically structured based on a list of objects of type Values.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| Values | java.util.List | Object of type Values that will be converted into text and sent as JSON. |
Return
( Out )
Returns the Out object itself
_out.json(Values: java.util.Map) : Out
Description
Generates a JSON response from a Map, using an instance of Values to structure the average content of the sample
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| Values | java.util.Map | The data contained in the Map will be automatically converted to JSON. |
Return
( Out )
Returns the Out object itself
_out.json(Values: Values) : Out
Description
Generates a formatted JSON response from an instance of the Values class.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| Values | Values | Object containing the data that will be automatically converted to JSON. |
Return
( Out )
Returns the Out object itself
jsonHTMLEscape
_out.jsonHTMLEscape() : boolean
Description
Checks the current status of the HTML character escape configuration in the JSON response.
This configuration determines whether special HTML characters (such as <, >, &, \‘) will be converted to HTML entities when generating JSON output.
Return
( boolean )
Returns true if HTML escaping is enabled, otherwise returns false.
_out.jsonHTMLEscape(htmlEscape: boolean) : Out
Description
Defines whether special HTML characters should be escaped in the generated JSON response.
When enabled (true), characters such as < , > , & and \ will be converted to their corresponding HTML entities ('<', '>', '&bsol', etc.), ensuring greater security when displaying JSON in HTML contexts.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| htmlEscape | boolean | true to escape HTML characters in JSON content. false to disable escaping. |
Return
( Out )
Returns the Out object itself
jsonIndentFactor
_out.jsonIndentFactor() : int
Description
The current value of the indentation factor used when generating the JSON response. This value controls the number of spaces used per indentation level in JSON.
Return
( int )
Returns the value of the JSON indentation factor.
_out.jsonIndentFactor(int: int) : Out
Description
Sets the indentation factor used when generating the JSON response. This value determines how many spaces will be used to indent each level of the JSON, making the output more readable for humans.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| int | int | Number of spaces used per indentation level. |
Return
( Out )
Returns the Out object itself
mirrors
_out.mirrors() : java.util.List<OutputStream>
Description
Gets the output replicas.
Return
( java.util.List )
List of replicas.
output
_out.output() : OutputStream
Description
Provides the original output stream.
Return
( OutputStream )
The original output stream..
print
_out.print(bool: boolean) : Out
Description
Sends the boolean result.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| bool | boolean | Boolean value that will be sent. |
Return
( Out )
Current data output.
_out.print(number: byte) : Out
Description
Sends the number.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| number | byte | Number that will be sent. |
Return
( Out )
Current data output.
_out.print(character: char) : Out
Description
Sends the character.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| character | char | Character that will be sent. |
Return
( Out )
Current data output.
_out.print(bool: double) : Out
Description
Sends the boolean result.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| bool | double | Boolean value that will be sent. |
Return
( Out )
Current data output.
_out.print(bool: float) : Out
Description
Sends the boolean result.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| bool | float | Boolean value that will be sent. |
Return
( Out )
Current data output.
_out.print(bool: int) : Out
Description
Sends the boolean result.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| bool | int | Boolean value that will be sent. |
Return
( Out )
Current data output.
_out.print(obj: java.lang.Object) : Out
Description
Converts the object to text and sends it.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| obj | java.lang.Object | Object that will be converted to text and sent. |
Return
( Out )
Current data output.
_out.print(text: string) : Out
Description
Sends the text content.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| text | string | Content that will be sent. |
Return
( Out )
Current data output.
_out.print(text: string, charset: string) : Out
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| text | string | |
| charset | string |
Return
( Out )
_out.print(text: string, charset: java.nio.charset.Charset) : Out
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| text | string | |
| charset | java.nio.charset.Charset |
Return
( Out )
_out.print(bool: long) : Out
Description
Sends the boolean result.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| bool | long | Boolean value that will be sent. |
Return
( Out )
Current data output.
_out.print(bool: short) : Out
Description
Sends the boolean result.
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| bool | short | Boolean value that will be sent. |
Return
( Out )
Current data output.
printAndClose
_out.printAndClose(v: boolean) : Out
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| v | boolean |
Return
( Out )