DataInputStream.java: Reformatted, Replaced < and & with html entitites in documentation.

2003-05-20  Michael Koch  <konqueror@gmx.de>

	* java/io/DataInputStream.java:
	Reformatted, Replaced < and & with html entitites in documentation.
	* java/io/File.java:
	Reformatted.
	* java/io/PrintWriter.java:
	Moved class documentation.

From-SVN: r66992
This commit is contained in:
Michael Koch 2003-05-20 09:13:19 +00:00 committed by Michael Koch
parent c2a40660aa
commit c93aa80414
4 changed files with 166 additions and 146 deletions

View File

@ -1,3 +1,12 @@
2003-05-20 Michael Koch <konqueror@gmx.de>
* java/io/DataInputStream.java:
Reformatted, Replaced < and & with html entitites in documentation.
* java/io/File.java:
Reformatted.
* java/io/PrintWriter.java:
Moved class documentation.
2003-05-20 Michael Koch <konqueror@gmx.de> 2003-05-20 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/ByteBufferImpl.java, * gnu/java/nio/ByteBufferImpl.java,

View File

@ -51,7 +51,7 @@ package java.io;
* @see DataInput * @see DataInput
* *
* @author Warren Levy <warrenl@cygnus.com> * @author Warren Levy <warrenl@cygnus.com>
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn <arenn@urbanophile.com>
* @date October 20, 1998. * @date October 20, 1998.
*/ */
public class DataInputStream extends FilterInputStream implements DataInput public class DataInputStream extends FilterInputStream implements DataInput
@ -169,7 +169,7 @@ public class DataInputStream extends FilterInputStream implements DataInput
* respectively, they will be transformed to a <code>char</code> in * respectively, they will be transformed to a <code>char</code> in
* the following manner: * the following manner:
* <p> * <p>
* <code>(char)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF)</code> * <code>(char)(((byte1 &amp; 0xFF) &lt;&lt; 8) | (byte2 &amp; 0xFF)</code>
* <p> * <p>
* This method can read a <code>char</code> written by an object * This method can read a <code>char</code> written by an object
* implementing the <code>writeChar()</code> method in the * implementing the <code>writeChar()</code> method in the
@ -301,8 +301,8 @@ public class DataInputStream extends FilterInputStream implements DataInput
* the first four bytes read from the stream, they will be * the first four bytes read from the stream, they will be
* transformed to an <code>int</code> in the following manner: * transformed to an <code>int</code> in the following manner:
* <p> * <p>
* <code>(int)(((byte1 & 0xFF) << 24) + ((byte2 & 0xFF) << 16) + * <code>(int)(((byte1 &amp; 0xFF) &lt;&lt; 24) + ((byte2 &amp; 0xFF) &lt;&lt; 16) +
* ((byte3 & 0xFF)<< 8) + (byte4 & 0xFF)))</code> * ((byte3 &amp; 0xFF)&lt;&lt; 8) + (byte4 &amp; 0xFF)))</code>
* <p> * <p>
* The value returned is in the range of -2147483648 to 2147483647. * The value returned is in the range of -2147483648 to 2147483647.
* <p> * <p>
@ -447,10 +447,10 @@ public class DataInputStream extends FilterInputStream implements DataInput
* the first eight bytes read from the stream, they will be * the first eight bytes read from the stream, they will be
* transformed to an <code>long</code> in the following manner: * transformed to an <code>long</code> in the following manner:
* <p> * <p>
* <code>(long)(((byte1 & 0xFF) << 56) + ((byte2 & 0xFF) << 48) + * <code>(long)(((byte1 &amp; 0xFF) &lt;&lt; 56) + ((byte2 &amp; 0xFF) &lt;&lt; 48) +
* ((byte3 & 0xFF) << 40) + ((byte4 & 0xFF) << 32) + * ((byte3 &amp; 0xFF) &lt;&lt; 40) + ((byte4 &amp; 0xFF) &lt;&lt; 32) +
* ((byte5 & 0xFF) << 24) + ((byte6 & 0xFF) << 16) + * ((byte5 &amp; 0xFF) &lt;&lt; 24) + ((byte6 &amp; 0xFF) &lt;&lt; 16) +
* ((byte7 & 0xFF) << 8) + (byte8 & 0xFF))) * ((byte7 &amp; 0xFF) &lt;&lt; 8) + (byte8 &amp; 0xFF)))
* </code> * </code>
* <p> * <p>
* The value returned is in the range of -9223372036854775808 to * The value returned is in the range of -9223372036854775808 to
@ -485,7 +485,7 @@ public class DataInputStream extends FilterInputStream implements DataInput
* respectively, they will be transformed to a <code>short</code>. in * respectively, they will be transformed to a <code>short</code>. in
* the following manner: * the following manner:
* <p> * <p>
* <code>(short)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF))</code> * <code>(short)(((byte1 &amp; 0xFF) &lt;&lt; 8) | (byte2 &amp; 0xFF))</code>
* <p> * <p>
* The value returned is in the range of -32768 to 32767. * The value returned is in the range of -32768 to 32767.
* <p> * <p>
@ -539,7 +539,7 @@ public class DataInputStream extends FilterInputStream implements DataInput
* respectively, they will be transformed to an <code>int</code> in * respectively, they will be transformed to an <code>int</code> in
* the following manner: * the following manner:
* <p> * <p>
* <code>(int)(((byte1 & 0xFF) << 8) + (byte2 & 0xFF))</code> * <code>(int)(((byte1 &amp; 0xFF) &lt;&lt; 8) + (byte2 &amp; 0xFF))</code>
* <p> * <p>
* The value returned is in the range of 0 to 65535. * The value returned is in the range of 0 to 65535.
* <p> * <p>
@ -697,6 +697,7 @@ public class DataInputStream extends FilterInputStream implements DataInput
{ {
if (b < 0) if (b < 0)
throw new EOFException (); throw new EOFException ();
return (b != 0); return (b != 0);
} }
@ -704,6 +705,7 @@ public class DataInputStream extends FilterInputStream implements DataInput
{ {
if (i < 0) if (i < 0)
throw new EOFException (); throw new EOFException ();
return (byte) i; return (byte) i;
} }
@ -711,28 +713,34 @@ public class DataInputStream extends FilterInputStream implements DataInput
{ {
if (i < 0) if (i < 0)
throw new EOFException (); throw new EOFException ();
return (i & 0xFF); return (i & 0xFF);
} }
static char convertToChar (byte[] buf) static char convertToChar (byte[] buf)
{ {
return (char) ((buf[0] << 8) | (buf[1] & 0xff)); return (char) ((buf [0] << 8)
| (buf [1] & 0xff));
} }
static short convertToShort (byte[] buf) static short convertToShort (byte[] buf)
{ {
return (short) ((buf[0] << 8) | (buf[1] & 0xff)); return (short) ((buf [0] << 8)
| (buf [1] & 0xff));
} }
static int convertToUnsignedShort (byte[] buf) static int convertToUnsignedShort (byte[] buf)
{ {
return (((buf[0] & 0xff) << 8) | (buf[1] & 0xff)); return (((buf [0] & 0xff) << 8)
| (buf [1] & 0xff));
} }
static int convertToInt (byte[] buf) static int convertToInt (byte[] buf)
{ {
return (((buf[0] & 0xff) << 24) | ((buf[1] & 0xff) << 16) | return (((buf [0] & 0xff) << 24)
((buf[2] & 0xff) << 8) | (buf[3] & 0xff)); | ((buf [1] & 0xff) << 16)
| ((buf [2] & 0xff) << 8)
| (buf [3] & 0xff));
} }
static long convertToLong (byte[] buf) static long convertToLong (byte[] buf)
@ -760,21 +768,23 @@ public class DataInputStream extends FilterInputStream implements DataInput
strbuf.append ((char) (buf [i++] & 0xFF)); strbuf.append ((char) (buf [i++] & 0xFF));
else if ((buf [i] & 0xE0) == 0xC0) // bit pattern 110xxxxx else if ((buf [i] & 0xE0) == 0xC0) // bit pattern 110xxxxx
{ {
if (i + 1 >= buf.length || (buf[i+1] & 0xC0) != 0x80) if (i + 1 >= buf.length
|| (buf [i + 1] & 0xC0) != 0x80)
throw new UTFDataFormatException (); throw new UTFDataFormatException ();
strbuf.append((char) (((buf[i++] & 0x1F) << 6) | strbuf.append((char) (((buf [i++] & 0x1F) << 6)
(buf[i++] & 0x3F))); | (buf [i++] & 0x3F)));
} }
else if ((buf [i] & 0xF0) == 0xE0) // bit pattern 1110xxxx else if ((buf [i] & 0xF0) == 0xE0) // bit pattern 1110xxxx
{ {
if (i + 2 >= buf.length || if (i + 2 >= buf.length
(buf[i+1] & 0xC0) != 0x80 || (buf[i+2] & 0xC0) != 0x80) || (buf [i + 1] & 0xC0) != 0x80
|| (buf [i + 2] & 0xC0) != 0x80)
throw new UTFDataFormatException (); throw new UTFDataFormatException ();
strbuf.append((char) (((buf[i++] & 0x0F) << 12) | strbuf.append ((char) (((buf [i++] & 0x0F) << 12)
((buf[i++] & 0x3F) << 6) | | ((buf [i++] & 0x3F) << 6)
(buf[i++] & 0x3F))); | (buf [i++] & 0x3F)));
} }
else // must be ((buf [i] & 0xF0) == 0xF0 || (buf [i] & 0xC0) == 0x80) else // must be ((buf [i] & 0xF0) == 0xF0 || (buf [i] & 0xC0) == 0x80)
throw new UTFDataFormatException (); // bit patterns 1111xxxx or throw new UTFDataFormatException (); // bit patterns 1111xxxx or

View File

@ -1001,6 +1001,7 @@ public class File implements Serializable, Comparable
if (prefix.length () < 3) if (prefix.length () < 3)
throw new IllegalArgumentException ("Prefix too short: " + prefix); throw new IllegalArgumentException ("Prefix too short: " + prefix);
if (suffix == null) if (suffix == null)
suffix = ".tmp"; suffix = ".tmp";

View File

@ -37,6 +37,12 @@ exception statement from your version. */
package java.io; package java.io;
/* 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.
* However, should use native methods for conversion.
*/
/** /**
* This class prints Java primitive values and objects to a stream as * This class prints Java primitive values and objects to a stream as
* text. None of the methods in this class throw an exception. However, * text. None of the methods in this class throw an exception. However,
@ -49,15 +55,9 @@ package java.io;
* in the chars written). * in the chars written).
* *
* @author Per Bothner <bothner@cygnus.com> * @author Per Bothner <bothner@cygnus.com>
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn <arenn@urbanophile.com>
* @date April 17, 1998. * @date April 17, 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.
* However, should use native methods for conversion.
*/
public class PrintWriter extends Writer public class PrintWriter extends Writer
{ {
/** /**