public static void readAndCloseStream(InputStream is){
  final byte[] bytes=new byte[DEFAULT_BUFFER_SIZE];
  try {
    while (is.read(bytes,0,DEFAULT_BUFFER_SIZE) != -1)     ;
  }
 catch (  IOException ignored) {
  }
 finally {
    closeSilently(is);
  }
}

public static void readAndCloseStream ( InputStream is ) { final byte [ ] bytes = new byte [ DEFAULT_BUFFER_SIZE ] ; try { while ( is . read ( bytes , 0 , DEFAULT_BUFFER_SIZE ) != - 1 ) ; } catch ( IOException ignored ) { } finally { closeSilently ( is ) ; } }
reads all data from stream and close it silently
