Skip to content

Instantly share code, notes, and snippets.

@tassioauad
Created November 14, 2016 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tassioauad/6d7afe869f64e63ad33185a379e1323f to your computer and use it in GitHub Desktop.
Save tassioauad/6d7afe869f64e63ad33185a379e1323f to your computer and use it in GitHub Desktop.
InputStream inputStream = context.getResources().openRawResource(R.raw.meuarquivo);
DataInputStream dataInputStream = new DataInputStream(inputStream);
byte [] fileBytes = new byte [(int) inputStream.available()];
dataInputStream.readFully(fileBytes);
dataInputStream.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment