×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Jordan Makris
Added: Mar 25, 2018 8:24 AM
Views: 2931
Tags: no tags
  1.     public static byte[] getBytes(final InputStream is) throws IOException {
  2.         byte[] buffer = new byte[1024];
  3.         int a = 0;
  4.         while ((a = is.read(buffer)) != -1) {
  5.             baos.write(buffer, 0, a);
  6.         }
  7.         baos.close();
  8.         buffer = null;
  9.         return baos.toByteArray();
  10. }