@@ -944,7 +944,7 @@ default long getRequestLength() {
944944 Route route = getRoute ();
945945 Renderer renderer = route .getRenderer ();
946946 byte [] bytes = renderer .render (this , value );
947- sendBytes (bytes );
947+ send (bytes );
948948 return this ;
949949 } catch (Exception x ) {
950950 throw Throwing .sneakyThrow (x );
@@ -1094,7 +1094,7 @@ default long getRequestLength() {
10941094 */
10951095 default @ Nonnull Context sendRedirect (@ Nonnull StatusCode redirect , @ Nonnull String location ) {
10961096 setHeader ("location" , location );
1097- return sendStatusCode (redirect );
1097+ return send (redirect );
10981098 }
10991099
11001100 /**
@@ -1103,8 +1103,8 @@ default long getRequestLength() {
11031103 * @param data Response. Use UTF-8 charset.
11041104 * @return This context.
11051105 */
1106- default @ Nonnull Context sendString (@ Nonnull String data ) {
1107- return sendString (data , StandardCharsets .UTF_8 );
1106+ default @ Nonnull Context send (@ Nonnull String data ) {
1107+ return send (data , StandardCharsets .UTF_8 );
11081108 }
11091109
11101110 /**
@@ -1114,32 +1114,32 @@ default long getRequestLength() {
11141114 * @param charset Charset.
11151115 * @return This context.
11161116 */
1117- @ Nonnull Context sendString (@ Nonnull String data , @ Nonnull Charset charset );
1117+ @ Nonnull Context send (@ Nonnull String data , @ Nonnull Charset charset );
11181118
11191119 /**
11201120 * Send response data.
11211121 *
11221122 * @param data Response.
11231123 * @return This context.
11241124 */
1125- @ Nonnull Context sendBytes (@ Nonnull byte [] data );
1125+ @ Nonnull Context send (@ Nonnull byte [] data );
11261126
11271127 /**
11281128 * Send response data.
11291129 *
11301130 * @param data Response.
11311131 * @return This context.
11321132 */
1133- @ Nonnull Context sendBytes (@ Nonnull ByteBuffer data );
1133+ @ Nonnull Context send (@ Nonnull ByteBuffer data );
11341134
11351135 /**
11361136 * Send response data.
11371137 *
11381138 * @param data Response.
11391139 * @return This context.
11401140 */
1141- default @ Nonnull Context sendBytes (@ Nonnull ByteBuf data ) {
1142- return sendBytes (data .nioBuffer ());
1141+ default @ Nonnull Context send (@ Nonnull ByteBuf data ) {
1142+ return send (data .nioBuffer ());
11431143 }
11441144
11451145 /**
@@ -1148,23 +1148,23 @@ default long getRequestLength() {
11481148 * @param channel Response input.
11491149 * @return This context.
11501150 */
1151- @ Nonnull Context sendBytes (@ Nonnull ReadableByteChannel channel );
1151+ @ Nonnull Context send (@ Nonnull ReadableByteChannel channel );
11521152
11531153 /**
11541154 * Send response data.
11551155 *
11561156 * @param input Response.
11571157 * @return This context.
11581158 */
1159- @ Nonnull Context sendStream (@ Nonnull InputStream input );
1159+ @ Nonnull Context send (@ Nonnull InputStream input );
11601160
11611161 /**
11621162 * Send a file attached response.
11631163 *
11641164 * @param file Attached file.
11651165 * @return This context.
11661166 */
1167- default @ Nonnull Context sendAttachment (@ Nonnull AttachedFile file ) {
1167+ default @ Nonnull Context send (@ Nonnull AttachedFile file ) {
11681168 setHeader ("Content-Disposition" , file .getContentDisposition ());
11691169 InputStream content = file .stream ();
11701170 long length = file .getFileSize ();
@@ -1173,9 +1173,9 @@ default long getRequestLength() {
11731173 }
11741174 setDefaultResponseType (file .getContentType ());
11751175 if (content instanceof FileInputStream ) {
1176- sendFile (((FileInputStream ) content ).getChannel ());
1176+ send (((FileInputStream ) content ).getChannel ());
11771177 } else {
1178- sendStream (content );
1178+ send (content );
11791179 }
11801180 return this ;
11811181 }
@@ -1186,10 +1186,10 @@ default long getRequestLength() {
11861186 * @param file File response.
11871187 * @return This context.
11881188 */
1189- default @ Nonnull Context sendFile (@ Nonnull Path file ) {
1189+ default @ Nonnull Context send (@ Nonnull Path file ) {
11901190 try {
11911191 setDefaultResponseType (MediaType .byFile (file ));
1192- return sendFile (FileChannel .open (file ));
1192+ return send (FileChannel .open (file ));
11931193 } catch (IOException x ) {
11941194 throw Throwing .sneakyThrow (x );
11951195 }
@@ -1201,25 +1201,15 @@ default long getRequestLength() {
12011201 * @param file File response.
12021202 * @return This context.
12031203 */
1204- @ Nonnull Context sendFile (@ Nonnull FileChannel file );
1204+ @ Nonnull Context send (@ Nonnull FileChannel file );
12051205
12061206 /**
12071207 * Send an empty response with the given status code.
12081208 *
12091209 * @param statusCode Status code.
12101210 * @return This context.
12111211 */
1212- @ Nonnull default Context sendStatusCode (@ Nonnull StatusCode statusCode ) {
1213- return sendStatusCode (statusCode .value ());
1214- }
1215-
1216- /**
1217- * Send an empty response with the given status code.
1218- *
1219- * @param statusCode Status code.
1220- * @return This context.
1221- */
1222- @ Nonnull Context sendStatusCode (int statusCode );
1212+ @ Nonnull Context send (@ Nonnull StatusCode statusCode );
12231213
12241214 /**
12251215 * Send an error response. Status code is computed via {@link Router#errorCode(Throwable)}.
0 commit comments