Valhalla Legends Forums Archive | Battle.net Bot Development | Java debuffer

AuthorMessageTime
OldMcDonald
I got the response from bnet as an inputstream. I wanna debuff the input stream which means I would have to break it down, assign it to a byte array and send it to iagos buffer class.

I know there is an easier way to do it so I'm looking for other ways. If anyone has sample source codes I can look or suggest something other than input please do so.
April 23, 2010, 9:58 PM
HdxBmx27
There is no real wrapper for a Stream class to 'debuff' data.
use .Read() in the Stream class to manually read a process the header. Then read the actual data in a big chunk. And pass it off to iago's Buffer class for processing.
April 23, 2010, 10:35 PM
OldMcDonald
so the read() takes out header info huh... which header we talking about? the ff 50 and length? Does it read it only or does it remove as well?

Also what wud be best to do with the info...
Should i place everything into an byte array and pass it on to buffer?

April 23, 2010, 11:56 PM
HdxBmx27
Why don't you teach yourself how to read the JavaDocs
Its easy to figure out what to do.
April 24, 2010, 12:01 AM
OldMcDonald
yea i know that but im saying does the input stream grab the whole entire packet? Or just the data + the bnet header?
April 24, 2010, 12:08 AM
HdxBmx27
Think of the input stream as a byte stream of the tcp data without the tcp header.
.Read() reads 1 byte and removes it from the stream.

So, in theory for the following packet:
FF 00 04 00
The first time you call .Read() it should return 0xFF, 2nd time returns 0x00, 3rd - 0x04, etc....
April 24, 2010, 12:16 AM
OldMcDonald
mmk thanks for explaining that lol. I'll see how it goes and ill ask more questions here.
April 24, 2010, 1:45 AM

Search