Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.         InputStream in = null;
  2.         try {
  3.             in = getBaseContext().getContentResolver().openInputStream(imageUri);
  4.         } catch (IOException e) {
  5.             e.printStackTrace();
  6.         } catch (NullPointerException e) {
  7.             e.printStackTrace();
  8.             return;
  9.         }
  10.         byte[] buf = new byte[0];
  11.         try {
  12.             assert in != null;
  13.             buf = new byte[in.available()];
  14.             while (in.read(buf) != -1) ;
  15.         } catch (IOException e) {
  16.             e.printStackTrace();
  17.         } catch (NullPointerException e) {
  18.             e.printStackTrace();
  19.             return;
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement