+ 4
Can send to me example code work on binary file in java? can help me ?
example code in binari file in java
7 Answers
+ 3
extra extra help me
+ 3
thanks, I want ready example code in binary file in java. best regards
+ 3
thanks, very good
+ 2
you can use FileInputStream and FileOutputStream It worths knowing there are a lot of other tools either
example:
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class Driver {
public static void main(String...args) throws IOException{
// Just because I didn't wanted to handle exceptions I throw it out of function
// Instantiate what we need
File readFile = new File("readFileAddress");
File writeFile = new File("writeFileAddress");
if(!writeFile.exists()){
writeFile.createNewFile();
}
FileInputStream reader = new FileInputStream(readFile);
FileOutputStream writer = new FileOutputStream(writeFile);
// lets read data and write it to another file
byte bytes[] = new byte[1024];
int count = 0;
while(reader.available()>0){
count = reader.read(bytes);
writer.write(bytes, 0, count);
}
reader.close();
writer.close();
}
}
+ 2
ok
+ 1
چاکر داش مصطفی دقیق تو چه زمینه برنامه نویسی مهارت دارید؟؟