/** * Returns the response channel if it exists. * * @return The response channel if it exists. */ @Override public WritableByteChannel getResponseEntityChannel() { try { return this.response.getByteChannel(); } catch (Exception ex) { return null; } }
/** * Used to write a message body with the <code>Response</code>. The * semantics of this <code>WritableByteChannel</code> are determined * by the HTTP version of the client, and whether or not the content * length has been set, through the <code>setContentLength</code> * method. If the length of the output is not known then the output * is chunked for HTTP/1.1 clients and closed for HTTP/1.0 clients. * * @return a writable byte channel used to write the message body */ public WritableByteChannel getByteChannel() throws IOException { return response.getByteChannel(); }
/** * Used to write a message body with the <code>Response</code>. The * semantics of this <code>WritableByteChannel</code> are determined * by the HTTP version of the client, and whether or not the content * length has been set, through the <code>setContentLength</code> * method. If the length of the output is not known then the output * is chunked for HTTP/1.1 clients and closed for HTTP/1.0 clients. * * @return a writable byte channel used to write the message body */ public WritableByteChannel getByteChannel() throws IOException { return response.getByteChannel(); }
/** * Used to write a message body with the <code>Response</code>. The * semantics of this <code>WritableByteChannel</code> are determined * by the HTTP version of the client, and whether or not the content * length has been set, through the <code>setContentLength</code> * method. If the length of the output is not known then the output * is chunked for HTTP/1.1 clients and closed for HTTP/1.0 clients. * * @return a writable byte channel used to write the message body */ public WritableByteChannel getByteChannel() throws IOException { return response.getByteChannel(); }
/** * Used to write a message body with the <code>Response</code>. The * semantics of this <code>WritableByteChannel</code> are determined * by the HTTP version of the client, and whether or not the content * length has been set, through the <code>setContentLength</code> * method. If the length of the output is not known then the output * is chunked for HTTP/1.1 clients and closed for HTTP/1.0 clients. * <p> * This will ensure that there is buffering done so that the output * can be reset using the <code>reset</code> method. This will * enable the specified number of bytes to be written without * committing the response. This specified size is the minimum size * that the response buffer must be. * * @param size the minimum size that the response buffer must be * * @return a writable byte channel used to write the message body */ public WritableByteChannel getByteChannel(int size) throws IOException { return response.getByteChannel(size); }
/** * Used to write a message body with the <code>Response</code>. The * semantics of this <code>WritableByteChannel</code> are determined * by the HTTP version of the client, and whether or not the content * length has been set, through the <code>setContentLength</code> * method. If the length of the output is not known then the output * is chunked for HTTP/1.1 clients and closed for HTTP/1.0 clients. * <p> * This will ensure that there is buffering done so that the output * can be reset using the <code>reset</code> method. This will * enable the specified number of bytes to be written without * committing the response. This specified size is the minimum size * that the response buffer must be. * * @param size the minimum size that the response buffer must be * * @return a writable byte channel used to write the message body */ public WritableByteChannel getByteChannel(int size) throws IOException { return response.getByteChannel(size); }
/** * Used to write a message body with the <code>Response</code>. The * semantics of this <code>WritableByteChannel</code> are determined * by the HTTP version of the client, and whether or not the content * length has been set, through the <code>setContentLength</code> * method. If the length of the output is not known then the output * is chunked for HTTP/1.1 clients and closed for HTTP/1.0 clients. * <p> * This will ensure that there is buffering done so that the output * can be reset using the <code>reset</code> method. This will * enable the specified number of bytes to be written without * committing the response. This specified size is the minimum size * that the response buffer must be. * * @param size the minimum size that the response buffer must be * * @return a writable byte channel used to write the message body */ public WritableByteChannel getByteChannel(int size) throws IOException { return response.getByteChannel(size); }
response.setDate("Last-Modified", time); response.setContentLength(data.length); response.getByteChannel().write(ByteBuffer.wrap(data)); response.getByteChannel().close(); } else if (request.getTarget().startsWith(BATCH_BLOCK_PATH)) { byte[] rb = com.google.common.io.BaseEncoding.base64Url().decode(request.getParameter("data")); response.setDate("Last-Modified", time); response.setContentLength(rslt.length); response.getByteChannel().write(ByteBuffer.wrap(rslt)); response.getByteChannel().close(); } else if (request.getTarget().startsWith(BATCH_BLOCK_POINTER)) { byte[] rb = com.google.common.io.BaseEncoding.base64Url().decode(request.getParameter("data")); response.setDate("Last-Modified", time); response.setContentLength(rslt.length); response.getByteChannel().write(ByteBuffer.wrap(rslt)); response.getByteChannel().close(); } else {