| #Java - Code Snippets for '#Java.io.ObjectOutputStream' - 2 code snippet(s) found |
|
Sample 1. Usage of ByteArrayOutputStream | |
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(validator);
oos.flush();
oos.close();
} catch (Exception e) {
}
|
|
Like Feedback java.io.ByteArrayOutputStream java.io ObjectOutputStream |
|
|
Sample 2. Code Sample / Example / Snippet of javax.naming.CompositeName | |
|
public static void main(String[] args) throws Exception {
CompositeName c = new CompositeName("aaa/bbb");
java.io.FileOutputStream f1 = new java.io.FileOutputStream("/tmp/ser");
java.io.ObjectOutputStream s1 = new java.io.ObjectOutputStream(f1);
s1.writeObject(c);
s1.close();
java.io.FileInputStream f2 = new java.io.FileInputStream("/tmp/ser");
java.io.ObjectInputStream s2 = new java.io.ObjectInputStream(f2);
c = (CompositeName)s2.readObject();
System.out.println("Size: " + c.size());
System.out.println("Size: " + c.snit);
}
|
|
Like Feedback javax.naming.CompositeName |
|
|