Skip to content

Instantly share code, notes, and snippets.

@sroebuck
Created September 7, 2011 20:24
Show Gist options
  • Select an option

  • Save sroebuck/1201627 to your computer and use it in GitHub Desktop.

Select an option

Save sroebuck/1201627 to your computer and use it in GitHub Desktop.

Revisions

  1. sroebuck created this gist Sep 7, 2011.
    7 changes: 7 additions & 0 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import java.lang.Readable
    import java.nio.CharBuffer
    import java.util.Scanner

    val readable = new Readable { def read(x: CharBuffer) = { x.put("12 34".reverse); 5} }
    def s = new Scanner(readable)
    assert(s.nextInt() == 43)