+2004-10-18 Michael Koch <konqueror@gmx.de>
+
+ * java/io/BufferedInputStream.java: Fixed @author tag.
+ (read): Simplified expression.
+ (read): Merged javadoc a bit more.
+ (read): Renamed 'remain' to 'totalBytesRead'.
+ * java/io/DataInputStream.java,
+ java/io/DataOutputStream.java,
+ java/io/ObjectInputStream.java,
+ java/io/ObjectOutputStream.java:
+ Reworked modifier order.
+
2004-10-18 Michael Koch <konqueror@gmx.de>
* java/net/Inet4Address.java: Merged file header and javadocs.
/* BufferedInputStream.java -- An input stream that implements buffering
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
* does.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Jeroen Frijters <jeroen@frijters.net>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Jeroen Frijters (jeroen@frijters.net)
*/
public class BufferedInputStream extends FilterInputStream
{
-
/**
* This is the default buffer size
*/
if (markpos >= 0 && pos - markpos > marktarget)
markpos = -1;
- return ((int) buf[pos++]) & 0xFF;
+ return buf[pos++] & 0xFF;
}
/**
* This method reads bytes from a stream and stores them into a caller
* supplied buffer. It starts storing the data at index <code>off</code>
* into the buffer and attempts to read <code>len</code> bytes. This method
- * can return before reading the number of bytes requested. The actual
- * number of bytes read is returned as an int. A -1 is returned to indicate
- * the end of the stream.
+ * can return before reading the number of bytes requested.
+ * The actual number of bytes read is returned as an int. A -1 is returned
+ * to indicate the end of the stream.
* <p>
* This method will block until some data can be read.
*
if (pos >= count && !refill())
return -1; // No bytes were read before EOF.
- int remain = Math.min(count - pos, len);
- System.arraycopy(buf, pos, b, off, remain);
- pos += remain;
+ int totalBytesRead = Math.min(count - pos, len);
+ System.arraycopy(buf, pos, b, off, totalBytesRead);
+ pos += totalBytesRead;
if (markpos >= 0 && pos - markpos > marktarget)
markpos = -1;
- return remain;
+ return totalBytesRead;
}
/**
*
* XXX: finish up comments
*/
- public static abstract class PutField
+ public abstract static class PutField
{
public abstract void put (String name, boolean value);
public abstract void put (String name, byte value);
}
// this value comes from 1.2 spec, but is used in 1.1 as well
- private final static int BUFFER_SIZE = 1024;
+ private static final int BUFFER_SIZE = 1024;
private static int defaultProtocolVersion = PROTOCOL_VERSION_2;