how should i send a binary file to sdcard such as image or .apk
<p>I use <code>'com.loopj.android:android-async-http:1.4.9'</code> to make a http request.I use BinaryHttpResponseHandler to get a image , but i want to send it to sdcard. 
My code is:</p>

<pre><code>AsyncHttpUtils.getBinary(url, new BinaryHttpResponseHandler(allowedContentTypes) {
        @Override
        public void onSuccess(int statusCode, Header[] headers, byte[] binaryData) {
            Log.d(TAG,"getFile onSuccess"+binaryData.length);
            String tempPath = "Download";
            // 文件地址
            String filePath =  tempPath +"/"+ "oktest" + ".jpg";
            FileUtils fileUtils = new FileUtils();
            InputStream inputstream = new ByteArrayInputStream(binaryData);
            if (inputstream != null) {
                fileUtils.write2SDFromInput(filePath, inputstream);
                try {
                    inputstream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        @Override
        public void onFailure(int statusCode, Header[] headers, byte[] binaryData, Throwable error) {
            Log.d(TAG,"getFile onFailure");
        }
    });
</code></pre>

<p>how can i send a binary file to sdcard?</p>