diff options
Diffstat (limited to 'Minecraft.World/DataInputStream.cpp')
| -rw-r--r-- | Minecraft.World/DataInputStream.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp index 3bdd5349..2291bf48 100644 --- a/Minecraft.World/DataInputStream.cpp +++ b/Minecraft.World/DataInputStream.cpp @@ -32,8 +32,8 @@ int DataInputStream::read() // //The read(b) method has the same effect as: // -// read(b, 0, b.length) -// +// read(b, 0, b.length) +// //Overrides: //read in class FilterInputStream //Parameters: @@ -102,7 +102,7 @@ unsigned char DataInputStream::readUnsignedByte() //Reads two input bytes and returns a char value. Let a be the first byte read and b be the second byte. The value returned is: //(char)((a << 8) | (b & 0xff)) -// +// //This method is suitable for reading bytes written by the writeChar method of interface DataOutput. //Returns: //the char value read. @@ -110,7 +110,7 @@ wchar_t DataInputStream::readChar() { int a = stream->read(); int b = stream->read(); - return (wchar_t)((a << 8) | (b & 0xff)); + return (wchar_t)((a << 8) | (b & 0xff)); } //Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b. @@ -170,7 +170,7 @@ bool DataInputStream::readFully(charArray b) //the double value read. double DataInputStream::readDouble() { - int64_t bits = readLong(); + __int64 bits = readLong(); return Double::longBitsToDouble( bits ); } @@ -188,10 +188,10 @@ float DataInputStream::readFloat() } //Reads four input bytes and returns an int value. Let a-d be the first through fourth bytes read. The value returned is: -// +// // (((a & 0xff) << 24) | ((b & 0xff) << 16) | // ((c & 0xff) << 8) | (d & 0xff)) -// +// //This method is suitable for reading bytes written by the writeInt method of interface DataOutput. //Returns: //the int value read. @@ -207,7 +207,7 @@ int DataInputStream::readInt() } //Reads eight input bytes and returns a long value. Let a-h be the first through eighth bytes read. The value returned is: -// +// // (((long)(a & 0xff) << 56) | // ((long)(b & 0xff) << 48) | // ((long)(c & 0xff) << 40) | @@ -216,23 +216,23 @@ int DataInputStream::readInt() // ((long)(f & 0xff) << 16) | // ((long)(g & 0xff) << 8) | // ((long)(h & 0xff))) -// +// //This method is suitable for reading bytes written by the writeLong method of interface DataOutput. // //Returns: //the long value read. -int64_t DataInputStream::readLong() +__int64 DataInputStream::readLong() { - int64_t a = stream->read(); - int64_t b = stream->read(); - int64_t c = stream->read(); - int64_t d = stream->read(); - int64_t e = stream->read(); - int64_t f = stream->read(); - int64_t g = stream->read(); - int64_t h = stream->read(); - - int64_t bits = (((a & 0xff) << 56) | + __int64 a = stream->read(); + __int64 b = stream->read(); + __int64 c = stream->read(); + __int64 d = stream->read(); + __int64 e = stream->read(); + __int64 f = stream->read(); + __int64 g = stream->read(); + __int64 h = stream->read(); + + __int64 bits = (((a & 0xff) << 56) | ((b & 0xff) << 48) | ((c & 0xff) << 40) | ((d & 0xff) << 32) | @@ -246,7 +246,7 @@ int64_t DataInputStream::readLong() //Reads two input bytes and returns a short value. Let a be the first byte read and b be the second byte. The value returned is: //(short)((a << 8) | (b & 0xff)) -// +// //This method is suitable for reading the bytes written by the writeShort method of interface DataOutput. //Returns: //the 16-bit value read. @@ -272,13 +272,13 @@ short DataInputStream::readShort() //then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // //(char)(((a& 0x1F) << 6) | (b & 0x3F)) -// +// //If the first byte of a group matches the bit pattern 1110xxxx, then the group consists of that byte a and two more bytes b and c. //If there is no byte c (because byte a was one of the last two of the bytes to be read), or either byte b or byte c does not match the bit //pattern 10xxxxxx, then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // // (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)) -// +// //If the first byte of a group matches the pattern 1111xxxx or the pattern 10xxxxxx, then a UTFDataFormatException is thrown. //If end of file is encountered at any time during this entire process, then an EOFException is thrown. // @@ -305,7 +305,7 @@ wstring DataInputStream::readUTF() outputString.push_back(theChar); }*/ - + unsigned short currentByteIndex = 0; while( currentByteIndex < UTFLength ) { @@ -390,7 +390,7 @@ wstring DataInputStream::readUTF() { // TODO 4J Stu - EOFException break; - } + } // No more bytes to read if( !(currentByteIndex < UTFLength) ) @@ -420,7 +420,7 @@ wstring DataInputStream::readUTF() continue; } } - + return outputString; } @@ -486,7 +486,7 @@ int DataInputStream::readUTFChar() { // TODO 4J Stu - EOFException return returnValue; - } + } int thirdByte = stream->read(); @@ -535,7 +535,7 @@ void DataInputStream::deleteChildStream() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -int64_t DataInputStream::skip(int64_t n) +__int64 DataInputStream::skip(__int64 n) { return stream->skip(n); } |
