• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cut the file into 32kb pieces  RSS feed

 
Abiram Radhakrishnan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We have the large files send to server (in MB) the reseiver can hold only 32kb at a time
Can any one tell me how to segment the file into 32kb irrespective of its size
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abiram,
Well you could do something like this:

That breaks the file up into 32K chunks and returns a byte array which can easily be pushed onto an OutputStream.
Michael Morris
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!