public static byte[] readAll(InputStream inStr) throws IOException {
  ByteArrayOutputStream buf=new ByteArrayOutputStream();
  pipeAll(inStr,buf);
  return buf.toByteArray();
}

public static byte [ ] readAll ( InputStream inStr ) throws IOException { ByteArrayOutputStream buf = new ByteArrayOutputStream ( ) ; pipeAll ( inStr , buf ) ; return buf . toByteArray ( ) ; }
read stream fully , returning contents in a byte array .
