Hello again,
Now that the packet sending works properly I've got a problem with the Reading. When I receive bytes from 80 - 9F I get wrong data.
Left expected, right actual data:
As you can see there are some bytes that have got the same data which breaks my workaround of replacing the wrong byte.
So does anyone have experienced such a thing?
I hope you don't save it in a char variable
in Java char has 2 bytes which would explain the high values
There's no way a single byte could represent a value higher than 255
I hope you don't save it in a char variable
in Java char has 2 bytes which would explain the high values
There's no way a single byte could represent a value higher than 255
That's the problem the InputStream of the Sockets is storing the input as 16 bits, storing this in byte would need a cast which will result in a lot of FFs, because as you said these are 2 bytes of data. (If the data is correct there is just one byte, that's how my current workaround is working except for the FFFD bytes.
That's the problem the InputStream of the Sockets is storing the input as 16 bits, storing this in byte would need a cast which will result in a lot of FFs, because as you said these are 2 bytes of data. (If the data is correct there is just one byte, that's how my current workaround is working except for the FFFD bytes.
How do you read the data?
I never used sockets in java, but since it's using normal Streams and there are read methods which return a byte array i doubt that it you can get 2 byte values at any time
How do you read the data?
I never used sockets in java, but since it's using normal Streams and there are read methods which return a byte array i doubt that it you can get 2 byte values at any time
I need to use chars, because of the workaround with a byte buffer this data gets cut off and results in FF. Usually the sockets return just bytes.
InputStreamReader is not the way you should go
DataInputStream should work out very well for you
There are methods for all primitive datatypes, which makes reading them a bit easier
InputStreamReader is not the way you should go
DataInputStream should work out very well for you
There are methods for all primitive datatypes, which makes reading them a bit easier
Yes had it before will use it again. Thanks again ^^
[JAVA Error] Could not create the java virtual machine 07/21/2013 - Technical Support - 10 Replies Schönen Abend!
Leider hat es sich aus einem unerfindlichen Grund ergeben, dass sobald ich die Minecraft.exe starten will die Errormeldung kommt.
Die Tips auf Minecraft.net habe ich schon ohne Erfolg befolgt.
Hoffe ihr könnt mir weiterhelfen...
Mein PC:
Java Sockets and phConnector 01/25/2012 - SRO Coding Corner - 6 Replies So I'd like to know if anyone tested if the java sockets send the packets correctly to the phConnector, reading the proxy's output seems to work fine,
but when I try to send a packet even if it's not valid nothing happens. At least the proxy seems to receive my packets, because when send an oversized packet I'm getting the "increase the max data size..." message.
[Java] Could not create the Java virtual machine 06/22/2011 - Minecraft - 1 Replies hallo ihr minecraftler ^^
habe seit heute das problem das wenn ich minecraft starte original als auch cracked das diese fehlermeldung kommt:
Java virtual machine Launcher
Could not create the Java virtual machine