From 1c872d63b8df0cec74db8fac7bba8f012ad99d4d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 12 Aug 2009 18:00:04 +0000 Subject: Adds Source.stdin convenience method. --- src/library/scala/io/Source.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala index 28be6c3f92..1d362cd285 100644 --- a/src/library/scala/io/Source.scala +++ b/src/library/scala/io/Source.scala @@ -24,6 +24,10 @@ object Source { val DefaultBufSize = 2048 val NoReset: () => Source = () => throw new UnsupportedOperationException() + /** Creates a Source from System.in. + */ + def stdin = fromInputStream(System.in) + def fromIterable(iterable: Iterable[Char]): Source = new Source { def reset() = fromIterable(iterable) val iter = iterable.iterator -- cgit v1.2.3