docs: public String getBucketPolicy(String bucketName)
      throws InvalidBucketNameException, InvalidObjectPrefixException, NoSuchAlgorithmException,
             InsufficientDataException, IOException, InvalidKeyException, NoResponseException,
             XmlPullParserException, ErrorResponseException, InternalException, BucketPolicyTooLargeException {
      Map<String,String> queryParamMap = new HashMap<>();
      queryParamMap.put("policy", "");
  
      HttpResponse response = null;
      byte[] buf = new byte[MAX_BUCKET_POLICY_SIZE];
      int bytesRead = 0;
  
      try {
        response = executeGet(bucketName, null, null, queryParamMap);
        bytesRead = response.body().byteStream().read(buf, 0, MAX_BUCKET_POLICY_SIZE);
        if (bytesRead < 0) {
          // reached EOF
          throw new IOException("reached EOF when reading bucket policy");
        }
  
        // Read one byte extra to ensure only MAX_BUCKET_POLICY_SIZE data is sent by the server.
        if (bytesRead == MAX_BUCKET_POLICY_SIZE) {
          int byteRead = 0;
          while (byteRead == 0) {
            byteRead = response.body().byteStream().read();
            if (byteRead < 0) {
              // reached EOF which is fine.
              break;
            } else if (byteRead > 0) {
              throw new BucketPolicyTooLargeException(bucketName);
            }
          }
        }
      } catch (ErrorResponseException e) {
        if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_BUCKET_POLICY) {
          throw e;
        }
      } finally {
        if (response != null && response.body() != null) {
          response.body().close();
        }
      }
  
      return new String(buf, 0, bytesRead, StandardCharsets.UTF_8);
    }