Skip to content

Commit e6d3324

Browse files
committed
adding more documentation
1 parent 2552184 commit e6d3324

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/structuredmessage/StructuredMessageEncoder.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package com.azure.storage.common.implementation.structuredmessage;
55

66
import com.azure.core.util.logging.ClientLogger;
7+
import com.azure.storage.common.implementation.BufferStagingArea;
78
import com.azure.storage.common.implementation.StorageCrc64Calculator;
89
import com.azure.storage.common.implementation.StorageImplUtils;
910
import reactor.core.publisher.Flux;
@@ -118,9 +119,14 @@ private byte[] generateSegmentHeader(int segmentContentSize) {
118119

119120
/**
120121
* Encodes the given buffer into a structured message format as a stream of ByteBuffers.
122+
* The encoder maintains mutable state and is designed for single, sequential subscription only.
123+
* Callers should pre-chunk input buffers to appropriate sizes (e.g., using {@link BufferStagingArea}) to
124+
* control memory usage.
121125
*
122126
* @param unencodedBuffer The buffer to be encoded.
123127
* @return A Flux of encoded ByteBuffers.
128+
* @throws IllegalArgumentException If the buffer length exceeds the content length, or the content has already been
129+
* encoded.
124130
*/
125131
public Flux<ByteBuffer> encode(ByteBuffer unencodedBuffer) {
126132
StorageImplUtils.assertNotNull("unencodedBuffer", unencodedBuffer);

0 commit comments

Comments
 (0)