diff --git a/bindings/java/src/main/java/org/apache/opendal/Operator.java b/bindings/java/src/main/java/org/apache/opendal/Operator.java index 63ede3829ee6..bb08c87a9aa2 100644 --- a/bindings/java/src/main/java/org/apache/opendal/Operator.java +++ b/bindings/java/src/main/java/org/apache/opendal/Operator.java @@ -72,6 +72,10 @@ public OperatorOutputStream createOutputStream(String path) { return new OperatorOutputStream(this, path); } + public OperatorOutputStream createOutputStream(String path, int maxBytes) { + return new OperatorOutputStream(this, path, maxBytes); + } + public byte[] read(String path) { return read(nativeHandle, path); } diff --git a/bindings/java/src/test/java/org/apache/opendal/test/behavior/RegressionTest.java b/bindings/java/src/test/java/org/apache/opendal/test/behavior/RegressionTest.java index c900899a29ce..2a9721b69473 100644 --- a/bindings/java/src/test/java/org/apache/opendal/test/behavior/RegressionTest.java +++ b/bindings/java/src/test/java/org/apache/opendal/test/behavior/RegressionTest.java @@ -36,7 +36,7 @@ public void testAzblobLargeFile() throws Exception { final int size = 16384 * 10; // 10 x OperatorOutputStream.DEFAULT_MAX_BYTES (10 flushes per write) final byte[] content = generateBytes(size); - try (OperatorOutputStream operatorOutputStream = op().createOutputStream(path)) { + try (OperatorOutputStream operatorOutputStream = op().createOutputStream(path, size)) { for (int i = 0; i < 20000; i++) { // More iterations in case BlockCountExceedsLimit doesn't pop up exactly after 100K blocks. operatorOutputStream.write(content);