summaryrefslogtreecommitdiff
path: root/libjava/java/io/InputStreamReader.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-24 15:43:22 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-24 15:43:22 +0000
commit66a5af9f944650beba25b77f584add09b33e10ce (patch)
tree750d1ed56fc294b0379fe7e0121d2ea862ae4dde /libjava/java/io/InputStreamReader.java
parentb8e27232744db1d2ad45d733d2499bd721a45637 (diff)
downloadgcc-66a5af9f944650beba25b77f584add09b33e10ce.tar.gz
2003-03-24 Michael Koch <konqueror@gmx.de>
* java/io/DataOutputStream.java (write): Merged from classpath. * java/io/File.java: Merged copyrigth with classpath. * java/io/FileInputStream.java (getChannel): Made it synchronized instead of using a synchronized block. * java/io/FileOutputStream.java: Reformatted. * java/io/InputStreamReader.java (InputStreamReader): Renamed enc to encoding_name. (close): Merged documentation from classpath. (getEncoding): Merged documentation from classpath. (ready): Merged documentation from classpath. (read): Merged documentation from classpath. * java/io/LineNumberReader.java (lineNumber): Made it private. (LineNumberReader): Use Constant instead of a direct value. * java/io/OutputStreamWriter.java (OutputStreamWriter): Renamed enc to encoding_scheme, merged documentation from classpath. (close): Merged documentation from classpath. (flush): Merged documentation from classpath. (write): Merged documentation from classpath. * java/io/PrintStream.java: Reformatted. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64806 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/io/InputStreamReader.java')
-rw-r--r--libjava/java/io/InputStreamReader.java39
1 files changed, 36 insertions, 3 deletions
diff --git a/libjava/java/io/InputStreamReader.java b/libjava/java/io/InputStreamReader.java
index 51ddf76f68c..70213b5f843 100644
--- a/libjava/java/io/InputStreamReader.java
+++ b/libjava/java/io/InputStreamReader.java
@@ -66,10 +66,10 @@ public class InputStreamReader extends Reader
this(in, BytesToUnicode.getDefaultDecoder());
}
- public InputStreamReader(InputStream in, String enc)
+ public InputStreamReader(InputStream in, String encoding_name)
throws UnsupportedEncodingException
{
- this(in, BytesToUnicode.getDecoder(enc));
+ this(in, BytesToUnicode.getDecoder(encoding_name));
}
private InputStreamReader(InputStream in, BytesToUnicode decoder)
@@ -88,6 +88,12 @@ public class InputStreamReader extends Reader
converter.setInput(this.in.buf, 0, 0);
}
+ /**
+ * This method closes this stream, as well as the underlying
+ * <code>InputStream</code>.
+ *
+ * @exception IOException If an error occurs
+ */
public void close() throws IOException
{
synchronized (lock)
@@ -100,11 +106,29 @@ public class InputStreamReader extends Reader
}
}
+ /**
+ * This method returns the name of the encoding that is currently in use
+ * by this object. If the stream has been closed, this method is allowed
+ * to return <code>null</code>.
+ *
+ * @param The current encoding name
+ */
public String getEncoding()
{
return in != null ? converter.getName() : null;
}
+ /**
+ * This method checks to see if the stream is read to be read. It
+ * will return <code>true</code> if is, or <code>false</code> if it is not.
+ * If the stream is not ready to be read, it could (although is not required
+ * to) block on the next read attempt.
+ *
+ * @return <code>true</code> if the stream is ready to be read,
+ * <code>false</code> otherwise
+ *
+ * @exception IOException If an error occurs
+ */
public boolean ready() throws IOException
{
synchronized (lock)
@@ -149,6 +173,13 @@ public class InputStreamReader extends Reader
}
}
+ /**
+ * This method reads a single character of data from the stream.
+ *
+ * @return The char read, as an int, or -1 if end of stream.
+ *
+ * @exception IOException If an error occurs
+ */
public int read() throws IOException
{
synchronized (lock)
@@ -198,4 +229,6 @@ public class InputStreamReader extends Reader
}
}
}
-}
+
+} // class InputStreamReader
+