blob: fdaf02e5ce3bc4626c64c550deab787b4eb0bc7f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
object Test {
def main(args: Array[String]): Unit = {
import java.io._
val bytes = new ByteArrayOutputStream()
val out = new ObjectOutputStream(bytes)
out.writeObject(())
out.close()
val buf = bytes.toByteArray
val in = new ObjectInputStream(new ByteArrayInputStream(buf))
val unit = in.readObject()
assert(unit == ())
}
}
|