turcsanyip commented on a change in pull request #4556:
URL: https://github.com/apache/nifi/pull/4556#discussion_r495961450



##########
File path: 
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureDataLakeStorage.java
##########
@@ -120,11 +122,29 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
 
                 final long length = flowFile.getSize();
                 if (length > 0) {
-                    try (final InputStream rawIn = session.read(flowFile); 
final BufferedInputStream in = new BufferedInputStream(rawIn)) {
-                        fileClient.append(in, 0, length);
+                    long chunkStart = 0;
+                    long chunkSize;
+
+                    try (final InputStream rawIn = session.read(flowFile);
+                         final BufferedInputStream in = new 
BufferedInputStream(rawIn) {
+                             @Override
+                             public int available() {
+                                 // 
com.azure.storage.common.Utility.convertStreamToByteBuffer() throws an exception
+                                 // if there are more available bytes in the 
stream after reading the chunk
+                                 return 0;

Review comment:
       @adenes Thanks for the idea. `BoundedInputStream` works properly here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to