code: protected final <T> T processStream( Binary binary,
                                           BinaryOperation<T> operation ) throws Exception {
          InputStream stream = binary.getStream();
          if (stream == null) {
              throw new IllegalArgumentException("The binary value is empty");
          }
  
          try {
              return operation.execute(stream);
          } finally {
              stream.close();
          }
      }
docs: Allows subclasses to process the stream of binary value property in "safe" fashion, making sure the stream is closed at the
  end of the operation.
  
  @param binary a {@link org.modeshape.jcr.api.Binary} who is expected to contain a non-null binary value.
  @param operation a {@link org.modeshape.jcr.api.text.TextExtractor.BinaryOperation} which should work with the stream
  @param <T> the return type of the binary operation
  @return whatever type of result the stream operation returns
  @throws Exception if there is an error processing the stream