docs: public static byte[] getBytesFromStream(InputStream inputStream, int hint) throws IOException {
      // Subclass ByteArrayOutputStream to avoid an extra byte[] allocation and copy
      ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(hint) {
        @Override
        public byte[] toByteArray() {
          // Can only use the raw buffer directly if the size is equal to the array we have.
          // Otherwise we have no choice but to copy.
          if (count == buf.length) {
            return buf;
          } else {
            return super.toByteArray();
          }
        }
      };
      ByteStreams.copy(inputStream, byteOutput);
      return byteOutput.toByteArray();
    }