Byte Writer with FileOutputStream
import java.io.FileOutputStream;
import java.io.IOException;
public class ByteWriter {
public static void main(String[] arguments) {
int[] data = { 137, 89, 82, 181, 50, 220, 103, 20, 0, 59 };
try {
FileOutputStream file = new FileOutputStream("pic.dat");
for (int i = 0; i < data.length; i++)
file.write(data[i]);
file.close();
} catch (IOException e) {
System.out.println("Error - " + e.toString());
}
}
}
Related examples in the same category