Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksandar Prokopec
committed
May 4, 2012
1 parent
f146d58
commit b2c3f87
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Map(a -> a, b -> b, c -> c) | ||
Map(a -> a, b -> b, c -> c) | ||
Set(a, b, c, d, e) | ||
Set(a, b, c, d, e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) | ||
} | ||
|
||
} |