This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cut the file into 32kb pieces

 
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
 
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!