/** * This method will print the specified integer to the output stream, * without filtering. This method is meant to be used to write the * response header. * * @param i data to be written */ protected void write(int i) { write(String.valueOf(i)); }
/** * This method will print the specified integer to the output stream, * without filtering. This method is meant to be used to write the response * header. * * @param i * data to be written */ protected void write(int i) { write(String.valueOf(i)); }
write(Constants.HTTP_11_BYTES); buf[pos++] = Constants.SP; switch (status) { case 200: write(Constants._200_BYTES); break; case 400: write(Constants._400_BYTES); break; case 404: write(Constants._404_BYTES); break; default: write(status); write(HttpMessages.getMessage(status)); } else { write(message.replace('\n', ' ').replace('\r', ' '));
/** * Send a header. * * @param name * Header name * @param value * Header value */ public void sendHeader(MessageBytes name, MessageBytes value) { if (name.getLength() > 0 && !value.isNull()) { write(name); buf[pos++] = Constants.COLON; buf[pos++] = Constants.SP; write(value); buf[pos++] = Constants.CR; buf[pos++] = Constants.LF; } }
write(Constants.HTTP_11_BYTES); buf[pos++] = Constants.SP; switch (status) { case 200: write(Constants._200_BYTES); break; case 400: write(Constants._400_BYTES); break; case 404: write(Constants._404_BYTES); break; default: write(status); write(HttpMessages.getMessage(status)); } else { write(message);
/** * This method will write the contents of the specyfied message bytes buffer * to the output stream, without filtering. This method is meant to be used * to write the response header. * * @param mb * data to be written */ protected void write(MessageBytes mb) { if (mb == null) { return; } switch (mb.getType()) { case MessageBytes.T_BYTES: write(mb.getByteChunk()); break; case MessageBytes.T_CHARS: write(mb.getCharChunk()); break; default: write(mb.toString()); break; } }
/** * This method will write the contents of the specyfied message bytes * buffer to the output stream, without filtering. This method is meant to * be used to write the response header. * * @param mb data to be written */ protected void write(MessageBytes mb) { if (mb.getType() == MessageBytes.T_BYTES) { ByteChunk bc = mb.getByteChunk(); write(bc); } else if (mb.getType() == MessageBytes.T_CHARS) { CharChunk cc = mb.getCharChunk(); write(cc); } else { write(mb.toString()); } }
} else if (headers.getValue("Server") == null) { outputBuffer.write(Constants.SERVER_BYTES);
headers.setValue("Server").setString(server); } else { outputBuffer.write(Constants.SERVER_BYTES);