private void sendAsFixedLength(OutputStream outputStream, PrintWriter pw) throws IOException {
            int pending = data != null ? data.available() : 0; // This is to support partial sends, see serveFile()
            pw.print("Content-Length: "+pending+"\r\n");

            pw.print("\r\n");
            pw.flush();

            if (requestMethod != Method.HEAD && data != null) {
                int BUFFER_SIZE = 16 * 1024;
                byte[] buff = new byte[BUFFER_SIZE];
                while (pending > 0) {
                    int read = data.read(buff, 0, ((pending > BUFFER_SIZE) ? BUFFER_SIZE : pending));
                    if (read <= 0) {
                        break;
                    }
                    outputStream.write(buff, 0, read);

                    pending -= read;
                }
            }
        }