Entries from 2011-11-07 to 1 day

Loan Patternいろいろ(using, scalazのwithResource, scala-arm)

まずはコード1を見てください。 // コード1 def copyFile() = { val in = new FileInputStream(new File("foo.txt")) val out = new FileOutputStream(new File("bar.txt")) val buf = new Array[Byte](1024) var len = 0; while ({ len = in.read(buf); len…