import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class z13 {
public static void main(String[] args) {
try {
OutputStream os = new FileOutputStream("/Users/eunsukkim/Desktop/text31.txt");
byte[] bytearr = new byte[5];
for(int i=0;i<5;i++){
bytearr[i] = (byte)(i*5);
}
//1 byte 를 1byte씩 출력
String num1 = "-128";
os.write(bytearr);
os.write(num1.getBytes());
os.flush();
os.close();
} catch (FileNotFoundException e) {
System.out.println(e.getMessage());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
댓글 영역