-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_code.java
More file actions
41 lines (35 loc) · 1.24 KB
/
test_code.java
File metadata and controls
41 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package thanh.Control;
import java.io.File;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import thanh.Model.*;
import java.util.ArrayList;
/**
*
* @author Do Chi Thanh
*/
public class test_code {
public static void main(String[] args) {
// Test ObjectInPutStream
ObjectInputStream ob = null;
try {
FileInputStream in = new FileInputStream(new File("C:\\Users\\Do Chi Thanh\\Documents\\NetBeansProjects\\hello,world\\Data.txt"));
ob = new ObjectInputStream(in);
ArrayList<ChiPhiPhatSinh> listSanPham = new ArrayList<ChiPhiPhatSinh>();
ChiPhiPhatSinh chiPhiPhatSinh = new ChiPhiPhatSinh();
do{
chiPhiPhatSinh = (ChiPhiPhatSinh)ob.readObject();
listSanPham.add(chiPhiPhatSinh);
System.out.println(chiPhiPhatSinh.toString() );
}
while(chiPhiPhatSinh != null);
} catch (Exception ex) {
System.out.println(ex);
}
}
}