troubleshooting Question

Java copying blocks of bytes from the file

Avatar of mkisiu
mkisiuFlag for Poland asked on
5 Comments1 Solution356 ViewsLast Modified:
I would like to ask for help.
I'm trying to perform the partial copying of the file in Java (as binary, using FileInputStream and FileOutputStream). By partial I mean I want to copy whole file but in blocks of 55516 bytes (as preparation for the next features in the application).
Pls find the code below:
Each block of bytes starts with 00000 (5 zeros). The problem is that after the copy has been made as the FileOut, the each block of bytes in the target file starts with 0000 (4 zeros) instead of 00000 (5 zeros).

Cld you pls help me to find my mistake?
Kind regards
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros