Содержание
- 2. V. Ввод - вывод 5. Сериализация
- 3. Сериализация объектов
- 4. Маркерный интерфейс Serializable package java.io; public interface Serializable { } I
- 5. Объектный поток вывода
- 6. Класс ObjectOutputStream package java.io; public class ObjectOutputStream extends OutputStream implements ObjectOutput, ObjectStreamConstants{ public ObjectOutputStream(OutputStream out) public
- 7. Объектный поток ввода
- 8. Класс ObjectInputStream package java.io; public class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants { public ObjectInputStream(InputStream in)
- 9. Сериализация и десериализация одного объекта
- 10. Сериализуемый класс class Employee implements Serializable { public Employee() { System.out.println("Employee object is being created using
- 11. Сериализация public class ObjectOutputDemo { public static void main(String[] args) { Employee bob = new Employee("Robert",
- 12. Десериализация class ObjectInputDemo { public static void main(String[] args) { FileInputStream fis = null; ObjectInputStream ois
- 13. Десериализация
- 14. Сериализация графа объектов
- 15. Сериализуемый класс со ссылкой public class Person implements Serializable{ public Person(String name) { this.name = name;
- 16. Сериализация public class TwoObjectsOutputDemo { public static void main(String[] args) { Person ann = new Person("Ann");
- 17. Сериализация Person constructor is called, name=Ann Person constructor is called, name=Bob [Person: name=Ann spouse=Bob] [Person: name=Bob
- 18. Десериализация class TwoObjectsInputDemo { public static void main(String[] args) { FileInputStream fis = null; ObjectInputStream ois
- 19. Несериализуемые поля
- 20. Несериализуемые поля
- 21. Класс с несериализуемым полем class Salesman implements Serializable { public Salesman(String n, double s) { name
- 22. Сериализация public class TransientOutputDemo { public static void main(String[] args) { Salesman bob = new Salesman("Robert",
- 23. Десериализация class TransientInputDemo { public static void main(String[] args) { FileInputStream fis = null; ObjectInputStream ois
- 24. UID
- 25. UID
- 26. I:\item>dir Volume in drive I has no label. Volume Serial Number is 44AB-CB89 Directory of I:\item
- 27. serialVersionUID
- 28. Класс с serialVersionUID public class ItemUID implements Serializable{ private static final long serialVersionUID = 5210454654602398740L; public
- 29. Сериализация public class UIDObjectOutputDemo { public static void main(String[] args) { ItemUID coffemaker = new ItemUID("Coffemaker",
- 30. Новый класс со старым serialVersionUID public class ItemUID implements Serializable{ private static final long serialVersionUID =
- 31. Десериализация class UIDObjectInputDemo { public static void main(String[] args) { FileInputStream fis = null; ObjectInputStream ois
- 32. readObject и writeObject
- 33. readObject и writeObject
- 34. Класс реализующий список с помощью массива public class StringArrayList implements Serializable { private transient int size
- 35. Сериализация public class CustomOutputDemo { public static void main(String[] args) { StringLinkedList sList = new StringLinkedList();
- 36. Десериализация class CustomInputDemo { public static void main(String[] args) { FileInputStream fis = null; ObjectInputStream ois
- 38. Скачать презентацию