public void streamFile(File file, DataOutputStream outStream) throws IOException {
        
        System.out.println("FILE STREAMING");
        long fileSize = file.length();
        long completed = 0;
        int step = 150000;
        outStream.flush();
        System.out.println("FILE STREAMING2");
        
        
        
        System.out.println("SIZE: "+fileSize);
         // creates the file stream
        FileInputStream fileStream = new FileInputStream(file);
        // sending a message before streaming the file
        System.out.println("START BUFFER");
        byte[] buffer = new byte[step];
        while (completed <= fileSize) {
            fileStream.read(buffer);
            System.out.println(buffer);
            outStream.write(buffer);
            completed += step;
            System.out.println("BUFFER STEP: "+step);
        }
        
        System.out.println("buffer: "+buffer.length);
        System.out.println("END BUFFERS");
        outStream.close();
    }