public static class NanoHTTPD.Response extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
protected static class |
NanoHTTPD.Response.ChunkedOutputStream |
static interface |
NanoHTTPD.Response.IStatus |
static class |
NanoHTTPD.Response.Status |
Modifier and Type | Field and Description |
---|---|
protected boolean |
chunkedTransfer |
protected long |
contentLength |
protected InputStream |
data |
protected boolean |
encodeAsGzip |
protected Map<String,String> |
header |
protected boolean |
keepAlive |
protected String |
mimeType |
protected NanoHTTPD.Method |
requestMethod |
protected NanoHTTPD.Response.IStatus |
status |
Modifier | Constructor and Description |
---|---|
protected |
Response(NanoHTTPD.Response.IStatus status,
String mimeType,
InputStream data,
long totalBytes) |
protected NanoHTTPD.Response.IStatus status
protected String mimeType
protected InputStream data
protected long contentLength
protected NanoHTTPD.Method requestMethod
protected boolean chunkedTransfer
protected boolean encodeAsGzip
protected boolean keepAlive
protected Response(NanoHTTPD.Response.IStatus status, String mimeType, InputStream data, long totalBytes)
protected static boolean headerAlreadySent(Map<String,String> header, String name)
protected static long sendContentLengthHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String,String> header, long size)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public InputStream getData()
public void setData(InputStream data)
public String getMimeType()
public void setMimeType(String mimeType)
public NanoHTTPD.Method getRequestMethod()
public void setRequestMethod(NanoHTTPD.Method requestMethod)
public NanoHTTPD.Response.IStatus getStatus()
public void setStatus(NanoHTTPD.Response.IStatus status)
public void setGzipEncoding(boolean encodeAsGzip)
public void setKeepAlive(boolean useKeepAlive)
protected void send(OutputStream outputStream)
protected void sendBodyWithCorrectTransferAndEncoding(OutputStream outputStream, long pending) throws IOException
IOException
protected void sendBodyWithCorrectEncoding(OutputStream outputStream, long pending) throws IOException
IOException
protected void sendBody(OutputStream outputStream, long pending) throws IOException
IOException
public void setChunkedTransfer(boolean chunkedTransfer)
Copyright © 2019 SimiaCryptus Software. All rights reserved.