public void blackHole(InputStream ins, DataOutputStream out) throws IOException{
        int bytesRead = 0;
        DataInputStream myStream = new DataInputStream(ins);
        //make the byteBuffer and back it with a large enough byte array.
        byte[] b = new byte[BYTES_IN_MEGABYTES];
        ByteBuffer buf = ByteBuffer.allocate(BYTES_IN_MEGABYTES);
        try {

            System.out.println("Attempting to read as much information from the client as possible.");
            long startTime = System.currentTimeMillis();
            //while the input stream has something available, keep filling, emptying and re-filling. 
            while (bytesRead < contentLength){
                if(myStream.available() > 0) {
                    int read = myStream.read(b);
                    if (read == -1)
                    {
                        System.out.println("Read -1, end of stream");
                        break;
                    }
                    bytesRead += read;
                    System.out.println("Read " + read + " this time (" + bytesRead + " total so far)");
                    buf.put(b);
                    Arrays.fill(b, (byte)0);
                    buf.clear();
                }
                if (System.currentTimeMillis() - startTime > 60000) {
                    System.out.println("timing out after reading " + bytesRead + " bytes");
                    break;
                }
            }
            out.writeBytes("HTTP/1.0 200 OK\r\n");
            //out.writeBytes("Bytes Read: " + bytesRead + "bytes\r\n");
            System.out.println("Done receiving data");
        }
        catch(IOException e){
            e.printStackTrace();
            System.out.println("Sending error response");
            //Write error if there's an IOException
            out.writeBytes("<html><head><title>error</title></head><body>\r\n\r\n");
            out.writeBytes("HTTP/1.0 400 " + e.getMessage() + "\r\n");
            out.writeBytes("Content-Type: text/html\r\n\r\n");
            out.writeBytes("</body></html>");
        }
        finally{
            try{
                ins.close();
                myStream.close();
            }
            catch(IOException ex){
                ex.printStackTrace();
            }
        }
    }