From 83f564f76ff896424c3ac8d6cde45867e9c083c0 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Tue, 6 May 2003 10:07:28 +0000 Subject: 2003-05-06 Michael Koch * java/io/DataOutputStream.java (write): Renamed argument to "value", merged documentation from classpath. (writeBoolean): Likewise. (writeByte): Likewise. (writeShort): Likewise. (writeChar): Likewise. (writeInt): Likewise. (writeLong): Likewise. (writeFloat): Likewise. (writeDouble): Likewise. (writeBytes): Likewise. (writeChars): Likewise. (writeUTF): Likewise. * java/io/File.java (performDelete): Added documentation. (performList): Likewise. (performMkdir): Likewise. (performSetReadOnly): Likewise. (performRenameTo): Likewise. (performSetLastModified): Likewise. (delete): Made it sychronized. (renameTo): Made it sychronized. (equals): Reformatted. (isHidden): Likewise. (listFiles): Likewise. (setReadOnly): Likewise. (listRoots): Likewise. (setLastModified): Likewise. (checkRead): Likewise. (checkWrite): Likewise. * java/io/FileInputStream.java (skip): Made it sychronized, merged from classpath. * java/io/FileOutputStream.java (write): Merged from classpath. * java/io/InputStreamReader.java: (InputStreamReader): Merged documentation from classpath. From-SVN: r66520 --- libjava/java/io/InputStreamReader.java | 65 +++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 5 deletions(-) (limited to 'libjava/java/io/InputStreamReader.java') diff --git a/libjava/java/io/InputStreamReader.java b/libjava/java/io/InputStreamReader.java index 70213b5..d01541d 100644 --- a/libjava/java/io/InputStreamReader.java +++ b/libjava/java/io/InputStreamReader.java @@ -37,17 +37,54 @@ exception statement from your version. */ package java.io; + import gnu.gcj.convert.*; /** + * This class reads characters from a byte input stream. The characters + * read are converted from bytes in the underlying stream by a + * decoding layer. The decoding layer transforms bytes to chars according + * to an encoding standard. There are many available encodings to choose + * from. The desired encoding can either be specified by name, or if no + * encoding is selected, the system default encoding will be used. The + * system default encoding name is determined from the system property + * file.encoding. The only encodings that are guaranteed to + * be availalbe are "8859_1" (the Latin-1 character set) and "UTF8". + * Unforunately, Java does not provide a mechanism for listing the + * ecodings that are supported in a given implementation. + *

+ * Here is a list of standard encoding names that may be available: + *

+ *

+ *

+ * It is recommended that applications do not use + * InputStreamReader's + * directly. Rather, for efficiency purposes, an object of this class + * should be wrapped by a BufferedReader. + *

+ * Due to a deficiency the Java class library design, there is no standard + * way for an application to install its own byte-character encoding. + * + * @see BufferedReader + * @see InputStream + * + * @author Aaron M. Renn (arenn@urbanophile.com) * @author Per Bothner * @date April 22, 1998. */ -/* Written using "Java Class Libraries", 2nd edition, plus online - * API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct, but only supports 8859_1. - */ - public class InputStreamReader extends Reader { BufferedInputStream in; @@ -61,11 +98,29 @@ public class InputStreamReader extends Reader BytesToUnicode converter; + /** + * This method initializes a new instance of InputStreamReader + * to read from the specified stream using the default encoding. + * + * @param in The InputStream to read from + */ public InputStreamReader(InputStream in) { this(in, BytesToUnicode.getDefaultDecoder()); } + /** + * This method initializes a new instance of InputStreamReader + * to read from the specified stream using a caller supplied character + * encoding scheme. Note that due to a deficiency in the Java language + * design, there is no way to determine which encodings are supported. + * + * @param in The InputStream to read from + * @param encoding_name The name of the encoding scheme to use + * + * @exception UnsupportedEncodingException If the encoding scheme + * requested is not available. + */ public InputStreamReader(InputStream in, String encoding_name) throws UnsupportedEncodingException { -- cgit v1.1