protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        response.setContentType("audio/mpeg3");
        response.reset();
        OutputStream out = response.getOutputStream();

        AWSCredentials s3Credentials = TransferManager.loadKeys();
        String bucketName = request.getParameter("bucketname");
        String musicFileName = request.getParameter("musicname");
        RestS3Service s3Service = TransferManager.connectToS3(s3Credentials);
        S3Object downloadedObject = TransferServer.downloadObject(s3Service, bucketName, musicFileName);


        // Read the data from the object's DataInputStream using a loop, and stream it out to your music player.

        int BUFF_SIZE = 1024;
        byte[] buffer = new byte[BUFF_SIZE];
        InputStream is = null;
        try
        {
            is = downloadedObject.getDataInputStream();  //plug the S3 obect data input stream to the servlet outputstream, so no local cache on the stream server side is done
            do
            {
                int byteCount = is.read(buffer);
                if (byteCount == -1)
                {
                    break;
                }
                out.write(buffer, 0, byteCount);
                out.flush();
            } while (true);
        } catch (Exception excp)
        {
            excp.printStackTrace();
        } finally
        {
            out.close();
            is.close();
        }

        downloadedObject.closeDataInputStream();
    }