Skip to content

Commit

Permalink
Addressed review comments of refactoring changes
Browse files Browse the repository at this point in the history
Signed-off-by: Vikas Bansal <43470111+vikasvb90@users.noreply.github.com>
  • Loading branch information
vikasvb90 committed Aug 25, 2023
1 parent cbbf7ea commit 02633e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
package org.opensearch.common.crypto;

import java.io.InputStream;
import java.util.function.Function;
import java.util.function.UnaryOperator;

/**
* Contains adjusted range of partial encrypted content which needs to be used for decryption.
*/
public class DecryptedRangedStreamProvider {

private final long[] adjustedRange;
private final Function<InputStream, InputStream> decryptedStreamProvider;
private final UnaryOperator<InputStream> decryptedStreamProvider;

/**
* To construct adjusted encrypted range.
* @param adjustedRange range of partial encrypted content which needs to be used for decryption.
* @param decryptedStreamProvider stream provider for decryption and range re-adjustment.
*/
public DecryptedRangedStreamProvider(long[] adjustedRange, Function<InputStream, InputStream> decryptedStreamProvider) {
public DecryptedRangedStreamProvider(long[] adjustedRange, UnaryOperator<InputStream> decryptedStreamProvider) {
this.adjustedRange = adjustedRange;
this.decryptedStreamProvider = decryptedStreamProvider;
}
Expand All @@ -42,7 +42,7 @@ public long[] getAdjustedRange() {
* desired range of decrypted content by skipping extra content which got decrypted as a result of range adjustment.
* @return stream provider for decryption and supplying the desired range of content.
*/
public Function<InputStream, InputStream> getDecryptedStreamProvider() {
public UnaryOperator<InputStream> getDecryptedStreamProvider() {
return decryptedStreamProvider;
}

Expand Down

This file was deleted.

0 comments on commit 02633e9

Please sign in to comment.