docs: private void checkLength(boolean eof) {
          if (eof) {
              if (dataLength != expectedLength) {
                  throw new SdkClientException(
                          "Data read has a different length than the expected: "
                                  + diagnosticInfo());
              }
          } else if (dataLength > expectedLength) {
              throw new SdkClientException("More data read than expected: "
                      + diagnosticInfo());
          }
      }