Imported GNU Classpath 0.19 + gcj-import-20051115.

* sources.am: Regenerated.
       * Makefile.in: Likewise.
       * scripts/makemake.tcl: Use glob -nocomplain.

From-SVN: r107049
This commit is contained in:
Mark Wielaard 2005-11-15 23:20:01 +00:00
parent 02e549bfaa
commit 8f523f3a10
1241 changed files with 97711 additions and 25284 deletions

View file

@ -70,6 +70,11 @@ public class PrintWriter extends Writer
* on this stream.
*/
private boolean error;
/**
* Indicates whether or not the stream has been closed.
*/
private boolean closed;
/**
* This is the underlying <code>Writer</code> we are sending output
@ -138,6 +143,68 @@ public class PrintWriter extends Writer
this.autoflush = autoflush;
}
/**
* This initializes a new PrintWriter object to write to the specified
* file. It creates a FileOutputStream object and wraps it in an
* OutputStreamWriter using the default encoding.
* @param file name of the file to write to
* @throws FileNotFoundException if the file cannot be written or created
*
* @since 1.5
*/
public PrintWriter(String file) throws FileNotFoundException
{
this(new FileOutputStream(file));
}
/**
* This initializes a new PrintWriter object to write to the specified
* file. It creates a FileOutputStream object and wraps it in an
* OutputStreamWriter using the specified encoding.
* @param file name of the file to write to
* @param enc the encoding to use
* @throws FileNotFoundException if the file cannot be written or created
* @throws UnsupportedEncodingException if the encoding is not supported
*
* @since 1.5
*/
public PrintWriter(String file, String enc)
throws FileNotFoundException, UnsupportedEncodingException
{
this(new OutputStreamWriter(new FileOutputStream(file), enc));
}
/**
* This initializes a new PrintWriter object to write to the specified
* file. It creates a FileOutputStream object and wraps it in an
* OutputStreamWriter using the default encoding.
* @param file the file to write to
* @throws FileNotFoundException if the file cannot be written or created
*
* @since 1.5
*/
public PrintWriter(File file) throws FileNotFoundException
{
this(new FileOutputStream(file));
}
/**
* This initializes a new PrintWriter object to write to the specified
* file. It creates a FileOutputStream object and wraps it in an
* OutputStreamWriter using the specified encoding.
* @param file the file to write to
* @param enc the encoding to use
* @throws FileNotFoundException if the file cannot be written or created
* @throws UnsupportedEncodingException if the encoding is not supported
*
* @since 1.5
*/
public PrintWriter(File file, String enc)
throws FileNotFoundException, UnsupportedEncodingException
{
this(new OutputStreamWriter(new FileOutputStream(file), enc));
}
/**
* This method can be called by subclasses to indicate that an error
* has occurred and should be reported by <code>checkError</code>.
@ -158,7 +225,8 @@ public class PrintWriter extends Writer
*/
public boolean checkError()
{
flush();
if (! closed)
flush();
return error;
}
@ -185,7 +253,8 @@ public class PrintWriter extends Writer
{
try
{
out.close();
out.close();
closed = true;
}
catch (IOException ex)
{
@ -310,7 +379,7 @@ public class PrintWriter extends Writer
* This is the system dependent line separator
*/
private static final char[] line_separator
= System.getProperty("line.separator").toCharArray();
= System.getProperty("line.separator", "\n").toCharArray();
/**
* This method prints a line separator sequence to the stream. The value