Java AsyncHttpClient: broken file while writing from LazyResponseBodyPart to AsynchronousFileChannel
问题 I use AsyncHttpClient library for async non blocking requests. My case: write data to a file as it is received over the network. For download file from remote host and save to file I used default ResponseBodyPartFactory.EAGER and AsynchronousFileChannel so as not to block the netty thread as data arrives. But as my measurements showed, in comparison with LAZY the memory consumption in the Java heap increases many times over. So I decided to go straight to LAZY , but did not consider the