Class ResponseLength

java.lang.Object
dev.mccue.jdk.httpserver.ResponseLength

public final class ResponseLength extends Object
The length (in bytes)of a response body that will be sent through an HttpExchange.

This is either a known quantity, in which case the body written must match the number of bytes specified, or unknown, in which case the response is sent with a chunked encoding.

The need for this arises out of an idiosyncrasy in the HttpExchange.sendResponseHeaders(int, long) method where 0 means that the size of a response is unknown and -1 means that there is no response body to send.