public void write(OutputStream out) throws IOException
	{
		PrintWriter pw = new PrintWriter(out);

		String line = "HTTP/1.0 " + status + " \r\n";

		pw.print(line);

		if (mimeType != null)
		{
			line = "Content-Type: " + mimeType + "\r\n";
			pw.print(line);
		}

		if (header != null)
		{
			Enumeration e = header.keys();
			while (e.hasMoreElements())
			{
				String key = (String) e.nextElement();
				String value = header.getProperty(key);
				line = key + ": " + value + "\r\n";
				pw.print(line);
			}
		}

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

		if (data != null)
		{
			int totalRead = 0;
			int size = data.available();
			byte[] buff = new byte[writeBufferSize];

			while (true)
			{
				int read = data.read(buff);

				if (read <= 0)
				{
					break;
				}

				totalRead += read;

				try
				{
					out.write(buff, 0, read);
				}
				catch (IOException e)
				{
					break;
				}
			}
		}
	}