+ 4

Can send to me example code work on binary file in java? can help me ?

example code in binari file in java

6th Jul 2017, 3:02 PM
Hossein Shirgahi
6 Réponses
+ 3
extra extra help me
6th Jul 2017, 3:43 PM
Hossein Shirgahi
+ 3
thanks, I want ready example code in binary file in java. best regards
7th Jul 2017, 8:08 AM
Hossein Shirgahi
+ 3
thanks, very good
7th Jul 2017, 5:36 PM
Hossein Shirgahi
+ 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(); } }
7th Jul 2017, 8:42 AM
Farbod Shahinfar
Farbod Shahinfar - avatar
+ 2
ok
14th Jul 2017, 3:27 PM
Hossein Shirgahi
+ 1
چاکر داش مصطفی دقیق تو چه زمینه برنامه نویسی مهارت دارید؟؟
9th Jul 2017, 8:19 AM
⇝ΛsłЛ⇜
⇝ΛsłЛ⇜ - avatar