blob: baf0503a04a7890a36c33a748b76187f360b8dc2 (
plain) (
blame)
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
|
import java.io._
import collection._
object Test {
def check(obj: AnyRef) {
println(obj)
val bos = new ByteArrayOutputStream()
val out = new ObjectOutputStream(bos)
out.writeObject(obj)
val arr = bos.toByteArray()
val in = new ObjectInputStream(new ByteArrayInputStream(arr))
val deser = in.readObject()
println(deser)
}
def main(args: Array[String]) {
val lhm = mutable.LinkedHashMap("a" -> "a", "b" -> "b", "c" -> "c")
val lhs = mutable.LinkedHashSet("a", "b", "c", "d", "e")
check(lhm)
check(lhs)
}
}
|