Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / libjava / classpath / java / lang / System.java
index 39d6da2..9d86991 100644 (file)
@@ -1,5 +1,5 @@
 /* System.java -- useful methods to interface with the system
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2012
    Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -45,6 +45,7 @@ import gnu.classpath.VMStackWalker;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
+import java.io.Console;
 import java.nio.channels.Channel;
 import java.nio.channels.spi.SelectorProvider;
 import java.util.AbstractCollection;
@@ -96,6 +97,8 @@ public final class System
    */
   public static final PrintStream out = VMSystem.makeStandardOutputStream();
 
+  private static final String LINE_SEPARATOR = SystemProperties.getProperty("line.separator");
+
   /**
    * The standard output PrintStream.  This is assigned at startup and
    * starts its life perfectly valid. Although it is marked final, you can
@@ -703,6 +706,24 @@ public final class System
     return SelectorProvider.provider().inheritedChannel();
   }
 
+  /*
+   * @since 1.6
+   */
+  public static Console console()
+  {
+    return Console.console();
+  }
+
+  /**
+   * Returns the system-dependent line separator.
+   *
+   * @return the system-dependent line separator.
+   */
+  public static String lineSeparator()
+  {
+    return LINE_SEPARATOR;
+  }
+
   /**
    * This is a specialised <code>Collection</code>, providing
    * the necessary provisions for the collections used by the