I\'m trying to get from an Android Uri to a byte array.
I have the following code, but it keeps telling me that the byte array is 61 bytes long, even though the fil
Sharing my idea :D
private static byte[] getStringFromInputStream(InputStream is)
{
BufferedReader br = null;
StringBuilder sb = new StringBuilder();
byte[] bReturn = new byte[0];
String line;
try
{
br = new BufferedReader(new InputStreamReader(is, "Big5"));
while ((line = br.readLine()) != null)
{
sb.append(line);
}
String sContent = sb.toString();
bReturn = sContent.getBytes();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (br != null)
{
try
{
br.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
return bReturn;
}