Help me see the code? Prawn help depressed for a long time

Category: Java SE
 
s20091019
2013-08-20 04:53:16

Sponsored Links
Here is a part of the source code java.io.DataInputStream
puzzled inside readFloat () function, could not understand where it was processed in a decimal floating-point?
its argument how yes yes a readInt () returns a four-byte integer ah
prawn quick to help me see, I was depressed for a long time.

package java.io;

public
class DataInputStream extends FilterInputStream implements DataInput {

public DataInputStream (InputStream in) {
super (in);
}

public final ; int read (byte b []) throws IOException {
return in.read (b, 0, b.length);
;}

public final int read (byte b [], int off, int len) throws IOException {
return in.read (b, off, len);
}

; public final void readFully (byte b []) throws IOException {
readFully (b, 0, b.length);
;}

public final void readFully (byte b [], int off, int len) throws IOException {
if (len <0)
throw new IndexOutOfBoundsException ();
InputStream in = this.in;
int n = 0;
while (n <len) {
int count = in.read (b, off + n, len - n);
if (count <0)
throw new EOFException ();
n + = ; count;
}
}

public final byte readByte () throws IOException {
int ch = in.read ();
if (ch <0)
throw new EOFException ();
return (byte) (ch);
}

public final int readInt () throws IOException {
InputStream in = this.in;
int ch1 = in.read ();
int ch2 = in. read ();
int ch3 = in.read ();
int ch4 = in.read ();
if ((ch1 | ; ch2 | ch3 | ch4) <0)
throw new EOFException ();
return ( (ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 ; << 0));
}

public final float readFloat () ; throws IOException {
return Float.intBitsToFloat (readInt ());
}

public final double readDouble () throws IOException {
return Double.longBitsToDouble (readLong ());
}

....................

}

Sponsored Links

missingi
2013-08-20 05:00:44
public static float intBitsToFloat (int bits) to see if the function bar
zwb19890602
2013-08-20 05:19:57
how to turn it into an integer float?

in the end bits is not an integer? If it is not an integer, then why int this modifier?

that since it is an integer, why converted to float? Where floating decimal point?

not understand said.
ranran_cool
2013-08-20 05:24:09
This is not an equal value, it turned into the first int byte [], then byte [] turned into float, its conversion mechanism above me to write a function, the value is not etc.!
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.