public static void main(String[] args) throws Exception { InputStream is = downFile('group1', 'M00/00/00/wKjThF1FBz-ARyy5AAoAAFSKsG8238.jpg'); FileOutputStream os = new FileOutputStream('C:/1.jpg'); byte[] bytes = new byte[1024]; while (is.read(bytes) != -1) { os.write(bytes); } os.flush(); os.close(); is.close(); }