code: static byte[] readInputStreamIntoByteArrayAndClose(InputStream inputStream) throws IOException {
  
          byte[] bytes = null;
          try{
              bytes = ByteStreams.toByteArray(inputStream);
          }catch(IOException e){
              throw e;
          } finally {
              IOUtils.closeQuietly(inputStream);
              if(bytes==null) {
                  bytes = new byte[ 1 ];
              }
          }
  
          return bytes;
      }
docs: Method reads an input stream into a byte array and closes the input stream when finished.
  Added for reading the remoting jar and generating a hash value for it.
  
  @param inputStream
  @return
  @throws IOException