code: public static void discardStream(InputStream is,int size) throws IOException {
  		byte[] buffer = new byte[size];
  		while(is.read(buffer, 0, size) != -1) {
  		}
  	}
docs: throw away all bytes from stream argument
  @param is InputStream to read and discard
  @param size number of bytes to read at once from the stream
  @throws IOException when is throws one