mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/GabsPuNs-MinecraftConsoles.git
synced 2026-06-23 01:05:59 +00:00
Use BYTE Win Typedef instead of byte typedef from Minecraft.World
"byte" wasnt working anymore for some reason
This commit is contained in:
@@ -17,11 +17,11 @@ void DataOutputStream::deleteChildStream()
|
||||
delete stream;
|
||||
}
|
||||
|
||||
//Writes the specified byte (the low eight bits of the argument b) to the underlying output stream.
|
||||
//Writes the specified BYTE (the low eight bits of the argument b) to the underlying output stream.
|
||||
//If no exception is thrown, the counter written is incremented by 1.
|
||||
//Implements the write method of OutputStream.
|
||||
//Parameters:
|
||||
//b - the byte to be written.
|
||||
//b - the BYTE to be written.
|
||||
void DataOutputStream::write(unsigned int b)
|
||||
{
|
||||
stream->write( b );
|
||||
@@ -34,7 +34,7 @@ void DataOutputStream::flush()
|
||||
stream->flush();
|
||||
}
|
||||
|
||||
//Writes b.length bytes from the specified byte array to this output stream.
|
||||
//Writes b.length bytes from the specified BYTE array to this output stream.
|
||||
//The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length).
|
||||
//Parameters:
|
||||
//b - the data.
|
||||
@@ -43,7 +43,7 @@ void DataOutputStream::write(byteArray b)
|
||||
write(b, 0, b.length);
|
||||
}
|
||||
|
||||
//Writes len bytes from the specified byte array starting at offset off to the underlying output stream.
|
||||
//Writes len bytes from the specified BYTE array starting at offset off to the underlying output stream.
|
||||
//If no exception is thrown, the counter written is incremented by len.
|
||||
//Parameters:
|
||||
//b - the data.
|
||||
@@ -63,17 +63,17 @@ void DataOutputStream::close()
|
||||
stream->close();
|
||||
}
|
||||
|
||||
//Writes out a byte to the underlying output stream as a 1-byte value. If no exception is thrown, the counter written is incremented by 1.
|
||||
//Writes out a BYTE to the underlying output stream as a 1-BYTE value. If no exception is thrown, the counter written is incremented by 1.
|
||||
//Parameters:
|
||||
//v - a byte value to be written.
|
||||
void DataOutputStream::writeByte(byte a)
|
||||
//v - a BYTE value to be written.
|
||||
void DataOutputStream::writeByte(BYTE a)
|
||||
{
|
||||
stream->write( a );
|
||||
}
|
||||
|
||||
//Converts the double argument to a long using the doubleToLongBits method in class Double,
|
||||
//and then writes that long value to the underlying output stream as an 8-byte quantity,
|
||||
//high byte first. If no exception is thrown, the counter written is incremented by 8.
|
||||
//and then writes that long value to the underlying output stream as an 8-BYTE quantity,
|
||||
//high BYTE first. If no exception is thrown, the counter written is incremented by 8.
|
||||
//Parameters:
|
||||
//v - a double value to be written.
|
||||
void DataOutputStream::writeDouble(double a)
|
||||
@@ -86,7 +86,7 @@ void DataOutputStream::writeDouble(double a)
|
||||
}
|
||||
|
||||
//Converts the float argument to an int using the floatToIntBits method in class Float,
|
||||
//and then writes that int value to the underlying output stream as a 4-byte quantity, high byte first.
|
||||
//and then writes that int value to the underlying output stream as a 4-BYTE quantity, high BYTE first.
|
||||
//If no exception is thrown, the counter written is incremented by 4.
|
||||
//Parameters:
|
||||
//v - a float value to be written.
|
||||
@@ -99,7 +99,7 @@ void DataOutputStream::writeFloat(float a)
|
||||
written += 4;
|
||||
}
|
||||
|
||||
//Writes an int to the underlying output stream as four bytes, high byte first. If no exception is thrown, the counter written is incremented by 4.
|
||||
//Writes an int to the underlying output stream as four bytes, high BYTE first. If no exception is thrown, the counter written is incremented by 4.
|
||||
//Parameters:
|
||||
//v - an int to be written.
|
||||
void DataOutputStream::writeInt(int a)
|
||||
@@ -112,7 +112,7 @@ void DataOutputStream::writeInt(int a)
|
||||
written += 4;
|
||||
}
|
||||
|
||||
//Writes a long to the underlying output stream as eight bytes, high byte first.
|
||||
//Writes a long to the underlying output stream as eight bytes, high BYTE first.
|
||||
//In no exception is thrown, the counter written is incremented by 8.
|
||||
//Parameters:
|
||||
//v - a long to be written.
|
||||
@@ -130,7 +130,7 @@ void DataOutputStream::writeLong(int64_t a)
|
||||
written += 4;
|
||||
}
|
||||
|
||||
//Writes a short to the underlying output stream as two bytes, high byte first.
|
||||
//Writes a short to the underlying output stream as two bytes, high BYTE first.
|
||||
//If no exception is thrown, the counter written is incremented by 2.
|
||||
//Parameters:
|
||||
//v - a short to be written.
|
||||
@@ -150,7 +150,7 @@ void DataOutputStream::writeUnsignedShort(unsigned short a)
|
||||
written += 2;
|
||||
}
|
||||
|
||||
//Writes a char to the underlying output stream as a 2-byte value, high byte first.
|
||||
//Writes a char to the underlying output stream as a 2-BYTE value, high BYTE first.
|
||||
//If no exception is thrown, the counter written is incremented by 2.
|
||||
//Parameters:
|
||||
//v - a char value to be written.
|
||||
@@ -177,14 +177,14 @@ void DataOutputStream::writeChars(const wstring& str)
|
||||
// Incrementing handled by the writeChar function
|
||||
}
|
||||
|
||||
//Writes a boolean to the underlying output stream as a 1-byte value.
|
||||
//The value true is written out as the value (byte)1; the value false is written out as the value (byte)0.
|
||||
//Writes a boolean to the underlying output stream as a 1-BYTE value.
|
||||
//The value true is written out as the value (BYTE)1; the value false is written out as the value (BYTE)0.
|
||||
//If no exception is thrown, the counter written is incremented by 1.
|
||||
//Parameters:
|
||||
//v - a boolean value to be written.
|
||||
void DataOutputStream::writeBoolean(bool b)
|
||||
{
|
||||
stream->write( b ? static_cast<byte>(1) : static_cast<byte>(0) );
|
||||
stream->write( b ? static_cast<BYTE>(1) : static_cast<BYTE>(0) );
|
||||
// TODO 4J Stu - Error handling?
|
||||
written += 1;
|
||||
}
|
||||
@@ -227,15 +227,15 @@ void DataOutputStream::writeUTF(const wstring& str)
|
||||
|
||||
byteArray bytearr(utflen+2);
|
||||
|
||||
bytearr[count++] = static_cast<byte>((utflen >> 8) & 0xFF);
|
||||
bytearr[count++] = static_cast<byte>((utflen >> 0) & 0xFF);
|
||||
bytearr[count++] = static_cast<BYTE>((utflen >> 8) & 0xFF);
|
||||
bytearr[count++] = static_cast<BYTE>((utflen >> 0) & 0xFF);
|
||||
|
||||
int i=0;
|
||||
for (i=0; i<strlen; i++)
|
||||
{
|
||||
c = str.at(i);
|
||||
if (!((c >= 0x0001) && (c <= 0x007F))) break;
|
||||
bytearr[count++] = static_cast<byte>(c);
|
||||
bytearr[count++] = static_cast<BYTE>(c);
|
||||
}
|
||||
|
||||
for (;i < strlen; i++)
|
||||
@@ -243,19 +243,19 @@ void DataOutputStream::writeUTF(const wstring& str)
|
||||
c = str.at(i);
|
||||
if ((c >= 0x0001) && (c <= 0x007F))
|
||||
{
|
||||
bytearr[count++] = static_cast<byte>(c);
|
||||
bytearr[count++] = static_cast<BYTE>(c);
|
||||
|
||||
}
|
||||
else if (c > 0x07FF)
|
||||
{
|
||||
bytearr[count++] = static_cast<byte>(0xE0 | ((c >> 12) & 0x0F));
|
||||
bytearr[count++] = static_cast<byte>(0x80 | ((c >> 6) & 0x3F));
|
||||
bytearr[count++] = static_cast<byte>(0x80 | ((c >> 0) & 0x3F));
|
||||
bytearr[count++] = static_cast<BYTE>(0xE0 | ((c >> 12) & 0x0F));
|
||||
bytearr[count++] = static_cast<BYTE>(0x80 | ((c >> 6) & 0x3F));
|
||||
bytearr[count++] = static_cast<BYTE>(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
else
|
||||
{
|
||||
bytearr[count++] = static_cast<byte>(0xC0 | ((c >> 6) & 0x1F));
|
||||
bytearr[count++] = static_cast<byte>(0x80 | ((c >> 0) & 0x3F));
|
||||
bytearr[count++] = static_cast<BYTE>(0xC0 | ((c >> 6) & 0x1F));
|
||||
bytearr[count++] = static_cast<BYTE>(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
}
|
||||
write(bytearr, 0, utflen+2);
|
||||
|
||||
Reference in New Issue
Block a user