ruaa.brt's Profile
Reputation: 0
Apprentice
- Group:
- New Members
- Active Posts:
- 4 (0.02 per day)
- Joined:
- 29-October 12
- Profile Views:
- 22
- Last Active:
Dec 13 2012 01:23 PM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: spliiting code in java-don't know what's wrong
Posted 12 Dec 2012
pbl, on 12 December 2012 - 12:59 PM, said:Not sure why you need thos embedded for(File file : files)
Don'see why you have to sort your file list
You said it does not work, sure it does not compile. Normally we would ask you: What does not work ?
But in your case it is obsious so fix your compilation error first.
what i'm trying to do is to divide a file into smaller files and then i named these files in the format like this (file.part0001)and so on, then i want to join these smalller files into one file, i sort the files to get them joined in order, i used substring to take the file name only without (.part00001). -
In Topic: spliiting code in java-don't know what's wrong
Posted 12 Dec 2012
pbl, on 12 December 2012 - 12:20 PM, said:Your ciode wouldn't wiork because it won't even compile
/>
If you indented it corectly it would become obvious
// creation of local variable file for (File file : fileList) { if (file.isFile()) { String fnm = file.getName(); int lastDot = fnm.lastIndexOf('.'); File[] files = (File[]) lst.toArray(new File[0]); Arrays.sort(files); System.out.println("size ="+files.length); System.out.println("hello"); /* Ensure that number of chunks match the length of array */ if (files.length == nChunks-1) { File ofile = new File(fname); FileOutputStream fos; FileInputStream fis; byte[] fileBytes; int bytesRead = 0; try { fos = new FileOutputStream(ofile,true); // -----------------> oups... another file here for (File file : files) {
what should I do??
i ran the program and it divides the file but i don't know what to do in the join code -
In Topic: spliiting code in java-don't know what's wrong
Posted 12 Dec 2012
g00se, on 12 December 2012 - 11:47 AM, said:No time to look at your code but take a look at http://www.techpaste...ad-size-slices/
thanks for the code.
but i want to know why my code doesn't work,
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Click here to e-mail me
Friends
ruaa.brt hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
ruaa.brt has no profile comments yet. Why not say hello?