From 74efe9f06d74d93ad2170566dd082689e2b676c5 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Tue, 28 Jul 2009 15:08:12 +0000 Subject: [PATCH] Fix for PR40616: missing java.io.PrintStream constructors. 2009-07-27 Andrew John Hughes PR libgcj/40616 * java/io/PrintStream.class: Regenerated. * java/io/PrintStream.h: Updated. * java/io/PrintStream.java: (PrintStream(File)): Ported from GNU Classpath version. (PrintStream(File, String)): Likewise. (PrintStream(String)): Likewise. (PrintStream(String, String)): Likewise. From-SVN: r150161 --- libjava/ChangeLog | 12 ++++ .../classpath/lib/java/io/PrintStream.class | Bin 7581 -> 8245 bytes .../tools/gjdoc/ConstructorDocImpl.class | Bin 757 -> 753 bytes libjava/java/io/PrintStream.h | 4 ++ libjava/java/io/PrintStream.java | 68 ++++++++++++++++++ 5 files changed, 84 insertions(+) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 477d5365009..3d9868ef8e6 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,15 @@ +2009-07-27 Andrew John Hughes + + PR libgcj/40616 + * java/io/PrintStream.class: Regenerated. + * java/io/PrintStream.h: Updated. + * java/io/PrintStream.java: + (PrintStream(File)): Ported from GNU Classpath + version. + (PrintStream(File, String)): Likewise. + (PrintStream(String)): Likewise. + (PrintStream(String, String)): Likewise. + 2009-07-24 Kai Tietz * gnu/java/security/jce/prng/natVMSecureRandomWin32.cc: New Win32 diff --git a/libjava/classpath/lib/java/io/PrintStream.class b/libjava/classpath/lib/java/io/PrintStream.class index c5db701b9df1dad7891cb8b36aa479392309311e..78d5cd79aa893231813feb355d62205fd9010d5a 100644 GIT binary patch literal 8245 zcmbVQ33yyrb^h<0kwzN7NV4Q{yhvVT9FIn^Eoi|s~8~X!) zpZwmuch7(Rv)*&xGr#!o1pwEm#W6SvZO79m(>>$)p1p>cweuuK)=tXbH{qNO-y*Xk@RrZQ)tSL=e(nn-bA{PF6Ijg&XGQa#!NnU z(kl>0Va3j4x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(NeR8JHmJnf9F zX(_TNTX$@;h6Ei$g4&P~ysx~A|G-zWjFEqjMmA8XT&(RGJv87t8Or}V#C4RDS(>h~ o_8%Fxe;VJ2;|jyI8HJ*#K0;MxdeGcoW0Nj?T*#K0;MxdeGcoW0Ng=Sf0+6T3z|5dDxss^@0RHa> Az5oCK diff --git a/libjava/java/io/PrintStream.h b/libjava/java/io/PrintStream.h index b76912e34ef..6247ba8292c 100644 --- a/libjava/java/io/PrintStream.h +++ b/libjava/java/io/PrintStream.h @@ -29,6 +29,10 @@ class java::io::PrintStream : public ::java::io::FilterOutputStream public: PrintStream(::java::io::OutputStream *); PrintStream(::java::io::OutputStream *, jboolean); + PrintStream(::java::io::File *); + PrintStream(::java::io::File *, ::java::lang::String *); + PrintStream(::java::lang::String *); + PrintStream(::java::lang::String *, ::java::lang::String *); PrintStream(::java::io::OutputStream *, jboolean, ::java::lang::String *); virtual jboolean checkError(); public: // actually protected diff --git a/libjava/java/io/PrintStream.java b/libjava/java/io/PrintStream.java index d3f386dc083..be28619059a 100644 --- a/libjava/java/io/PrintStream.java +++ b/libjava/java/io/PrintStream.java @@ -122,6 +122,74 @@ public class PrintStream extends FilterOutputStream implements Appendable this.auto_flush = auto_flush; } + /** + * This method initializes a new PrintStream object to write + * to the specified output File. Doesn't autoflush. + * + * @param file The File to write to. + * @throws FileNotFoundException if an error occurs while opening the file. + * + * @since 1.5 + */ + public PrintStream (File file) + throws FileNotFoundException + { + this (new FileOutputStream(file), false); + } + + /** + * This method initializes a new PrintStream object to write + * to the specified output File. Doesn't autoflush. + * + * @param file The File to write to. + * @param encoding The name of the character encoding to use for this + * object. + * @throws FileNotFoundException If an error occurs while opening the file. + * @throws UnsupportedEncodingException If the charset specified by + * encoding is invalid. + * + * @since 1.5 + */ + public PrintStream (File file, String encoding) + throws FileNotFoundException,UnsupportedEncodingException + { + this (new FileOutputStream(file), false, encoding); + } + + /** + * This method initializes a new PrintStream object to write + * to the specified output File. Doesn't autoflush. + * + * @param fileName The name of the File to write to. + * @throws FileNotFoundException if an error occurs while opening the file, + * + * @since 1.5 + */ + public PrintStream (String fileName) + throws FileNotFoundException + { + this (new FileOutputStream(new File(fileName)), false); + } + + /** + * This method initializes a new PrintStream object to write + * to the specified output File. Doesn't autoflush. + * + * @param fileName The name of the File to write to. + * @param encoding The name of the character encoding to use for this + * object. + * @throws FileNotFoundException if an error occurs while opening the file. + * @throws UnsupportedEncodingException If the charset specified by + * encoding is invalid. + * + * @since 1.5 + */ + public PrintStream (String fileName, String encoding) + throws FileNotFoundException,UnsupportedEncodingException + { + this (new FileOutputStream(new File(fileName)), false, encoding); + } + /** * This method intializes a new PrintStream object to write * to the specified output sink. This constructor also allows "auto-flush"