code: public static void validateReservedDatastream(PID pid,
                                                    String dsId,
                                                    Datastream ds)
              throws ValidationException {
  
          // NB: only want to generate inputstream from .getContentStream() once
          // we know that this is a datastream to validate
          // to prevent reading of non-reserved datstream content when it is not needed
          InputStream content = null;
  
          try {
          if ("POLICY".equals(dsId)) {
              content = ds.getContentStream();
              validatePOLICY(content);
          } else if ("FESLPOLICY".equals(dsId)) {
              content = ds.getContentStream();
              validateFESLPOLICY(content);
          } else if ("RELS-EXT".equals(dsId) || "RELS-INT".equals(dsId)) {
                  content = ds.getContentStream();
              validateRELS(pid, dsId, content);
              }
          } catch (StreamIOException e) {
              throw new ValidationException("Failed to get content stream for " + pid + "/" + dsId + ": " + e.getMessage(), e);
          }
  
          if (content != null) {
              try {
                  content.close();
              } catch (IOException e) {
                  throw new ValidationException("Error closing content stream for " + pid + "/" + dsId + ": " + e.getMessage(), e);
              }
          }
      }
docs: Validates the given datastream if it's a reserved datastream.
  
  The given stream is guaranteed to be closed when this method completes.