Skip to content

Commit

Permalink
Enable configurable write buffer block size.
Browse files Browse the repository at this point in the history
  • Loading branch information
linlin-s committed Nov 16, 2023
1 parent 0d0258c commit fa11a5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/com/amazon/ion/impl/_Private_IonBinaryWriterBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ public _Private_IonBinaryWriterBuilder withLocalSymbolTableAppendDisabled()
return b;
}

@Override
public _Private_IonBinaryWriterBuilder withDefaultBlockSize(int size) {
_Private_IonBinaryWriterBuilder b = mutable();
b.setDefaultBlockSize(size);
return b;
}

@Override
public void setIsFloatBinary32Enabled(boolean enabled) {
mutationCheck();
Expand Down Expand Up @@ -275,6 +282,9 @@ public void setStreamCopyOptimized(final boolean optimized)

//=========================================================================

public void setDefaultBlockSize(int size) {
myBinaryWriterBuilder.withUserBlockSize(size);
}

/**
* Fills all properties and returns an immutable builder.
Expand Down
6 changes: 6 additions & 0 deletions src/com/amazon/ion/system/IonBinaryWriterBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ public IvmMinimizing getIvmMinimizing()
*/
public abstract IonBinaryWriterBuilder withLocalSymbolTableAppendDisabled();

/**
* Specify the default block size for write buffer.
* @param size represent the specified block size in bytes.
* If this functionality is not set, the default block size is 32768 bytes.
*/
public abstract IonBinaryWriterBuilder withDefaultBlockSize(int size);

/**
* Enables or disables writing Binary32 (4-byte, single precision,
Expand Down

0 comments on commit fa11a5f

Please sign in to comment.