BufferedInputStream.java: Fixed @author tag.
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. From-SVN: r89218
This commit is contained in:
parent
ba3ed8d806
commit
0736f19f4e
|
@ -1,3 +1,15 @@
|
||||||
|
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>
|
2004-10-18 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* java/net/Inet4Address.java: Merged file header and javadocs.
|
* java/net/Inet4Address.java: Merged file header and javadocs.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* BufferedInputStream.java -- An input stream that implements buffering
|
/* 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.
|
This file is part of GNU Classpath.
|
||||||
|
|
||||||
|
@ -60,12 +60,11 @@ package java.io;
|
||||||
* does.
|
* does.
|
||||||
*
|
*
|
||||||
* @author Aaron M. Renn (arenn@urbanophile.com)
|
* @author Aaron M. Renn (arenn@urbanophile.com)
|
||||||
* @author Warren Levy <warrenl@cygnus.com>
|
* @author Warren Levy (warrenl@cygnus.com)
|
||||||
* @author Jeroen Frijters <jeroen@frijters.net>
|
* @author Jeroen Frijters (jeroen@frijters.net)
|
||||||
*/
|
*/
|
||||||
public class BufferedInputStream extends FilterInputStream
|
public class BufferedInputStream extends FilterInputStream
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the default buffer size
|
* This is the default buffer size
|
||||||
*/
|
*/
|
||||||
|
@ -235,16 +234,16 @@ public class BufferedInputStream extends FilterInputStream
|
||||||
if (markpos >= 0 && pos - markpos > marktarget)
|
if (markpos >= 0 && pos - markpos > marktarget)
|
||||||
markpos = -1;
|
markpos = -1;
|
||||||
|
|
||||||
return ((int) buf[pos++]) & 0xFF;
|
return buf[pos++] & 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method reads bytes from a stream and stores them into a caller
|
* 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>
|
* 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
|
* into the buffer and attempts to read <code>len</code> bytes. This method
|
||||||
* can return before reading the number of bytes requested. The actual
|
* can return before reading the number of bytes requested.
|
||||||
* number of bytes read is returned as an int. A -1 is returned to indicate
|
* The actual number of bytes read is returned as an int. A -1 is returned
|
||||||
* the end of the stream.
|
* to indicate the end of the stream.
|
||||||
* <p>
|
* <p>
|
||||||
* This method will block until some data can be read.
|
* This method will block until some data can be read.
|
||||||
*
|
*
|
||||||
|
@ -267,14 +266,14 @@ public class BufferedInputStream extends FilterInputStream
|
||||||
if (pos >= count && !refill())
|
if (pos >= count && !refill())
|
||||||
return -1; // No bytes were read before EOF.
|
return -1; // No bytes were read before EOF.
|
||||||
|
|
||||||
int remain = Math.min(count - pos, len);
|
int totalBytesRead = Math.min(count - pos, len);
|
||||||
System.arraycopy(buf, pos, b, off, remain);
|
System.arraycopy(buf, pos, b, off, totalBytesRead);
|
||||||
pos += remain;
|
pos += totalBytesRead;
|
||||||
|
|
||||||
if (markpos >= 0 && pos - markpos > marktarget)
|
if (markpos >= 0 && pos - markpos > marktarget)
|
||||||
markpos = -1;
|
markpos = -1;
|
||||||
|
|
||||||
return remain;
|
return totalBytesRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -651,7 +651,7 @@ public class DataInputStream extends FilterInputStream implements DataInput
|
||||||
*
|
*
|
||||||
* @see DataInput#readUTF
|
* @see DataInput#readUTF
|
||||||
*/
|
*/
|
||||||
public final static String readUTF (DataInput in) throws IOException
|
public static final String readUTF(DataInput in) throws IOException
|
||||||
{
|
{
|
||||||
final int UTFlen = in.readUnsignedShort ();
|
final int UTFlen = in.readUnsignedShort ();
|
||||||
byte[] buf = new byte [UTFlen];
|
byte[] buf = new byte [UTFlen];
|
||||||
|
|
|
@ -404,7 +404,7 @@ public class DataOutputStream extends FilterOutputStream implements DataOutput
|
||||||
*
|
*
|
||||||
* @see DataInput#readUTF
|
* @see DataInput#readUTF
|
||||||
*/
|
*/
|
||||||
public synchronized final void writeUTF (String value) throws IOException
|
public final synchronized void writeUTF(String value) throws IOException
|
||||||
{
|
{
|
||||||
int len = value.length();
|
int len = value.length();
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
|
@ -1120,7 +1120,7 @@ public class ObjectInputStream extends InputStream
|
||||||
*
|
*
|
||||||
* XXX: finish up comments
|
* XXX: finish up comments
|
||||||
*/
|
*/
|
||||||
public static abstract class GetField
|
public abstract static class GetField
|
||||||
{
|
{
|
||||||
public abstract ObjectStreamClass getObjectStreamClass();
|
public abstract ObjectStreamClass getObjectStreamClass();
|
||||||
|
|
||||||
|
|
|
@ -893,7 +893,7 @@ public class ObjectOutputStream extends OutputStream
|
||||||
*
|
*
|
||||||
* XXX: finish up comments
|
* 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, boolean value);
|
||||||
public abstract void put (String name, byte value);
|
public abstract void put (String name, byte value);
|
||||||
|
@ -1552,7 +1552,7 @@ public class ObjectOutputStream extends OutputStream
|
||||||
}
|
}
|
||||||
|
|
||||||
// this value comes from 1.2 spec, but is used in 1.1 as well
|
// 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;
|
private static int defaultProtocolVersion = PROTOCOL_VERSION_2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue