2014-02-28 65 views

回答

1

首先轉換RAW文件爲byte[]

InputStream inStream = context.getResources().openRawResource(R.raw.sendvideo); 
byte[] video = new byte[inStream.available()]; 

使用在Android Base64

public static byte[] encode (byte[] input, int flags)

byte[] base64 = Base64.encode(video,Base64.DEFAULT); 

public static byte[] decode (byte[] input, int offset, int len, int flags)

byte[] rowVideoAgain = Base64.decode(base64,0,base64.length,Base64.DEFAULT); 

http://developer.android.com/reference/android/util/Base64.html

你應該開始這一場的AsyncTask http://developer.android.com/reference/android/os/AsyncTask.html

+0

好吧,抱歉,我以爲你想要編碼字符串 – PhiG

+0

沒有老兄,我知道它 – userDroid

相關問題