Skip to content

Instantly share code, notes, and snippets.

@sroebuck
Created September 7, 2011 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sroebuck/1201627 to your computer and use it in GitHub Desktop.
Save sroebuck/1201627 to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment