How could I upload a large file in chunks using Java?

前端 未结 5 670
夕颜
夕颜 2020-12-03 15:40

I need to upload a large file in chunks using Java.

Is there any sample code I can refer to?

5条回答
  •  难免孤独
    2020-12-03 16:11

    Use a RandomAccessFile. This has already been covered on SO I believe.

    java file input with rewind()/reset() capability

    Basically you'd just seek to the starting point, write however many bytes you want to from there, and remember the point you stopped writing from.

提交回复
热议问题