Blog

RSS Feed

1 

Page: 

Java: Writing an XML HTTP Server.

13 February 2009
What am I doing? Rewriting the wheel!
Why is it that Java (BufferedReader(InputStreamReader(InputStream))) reads everything in my HTTP POST request fine up until the actual POST BODY?!

It only reads the POST BODY once PHP has timed out. :(
Well, in relation to my last journal on Harmonia_Game_Engine (which I forgot to tag...), I'll make a note to remember.

Don't use BufferedReader if dealing with InputStreams; use StringBuffer.

But why? You may think the BufferedReader's readLine() method is good, because it reads you a line (yep, no parsing of ints to chars), but when it comes to the last line in your stream, it doesnt return -1.

So in revision, don't check for -1 if you want to break out of a 'read input stream loop', use an \"end of stream\" set of characters or equivilent.
Share:
Share on Facebook
Tags:

Tags

Buddy Blogs

I OH U - knitetgantt

The mastermind behind my game, Click The Pixel.
http://iohu.blogspot.com/

Ted Lauterbach - rotten_tater

The crazy developer of the awesome game Thunder Gun, as well as most other things that are awesome.
http://www.rottentater.com/

Another Early Morning - Alex Schearer

Alex Schearer created the fluentfx library which I used in Inverse Polarity.
http://www.anotherearlymorning.com/

Indie Games

Let's face it, what indie gamer or developer doesn't follow this one?
http://www.indiegames.com/blog/

Inkidia

The developer of Voltorometer, a game that was entered into the Game Jolt shocking contest. Sequel in the works!
http://www.inkidia.net/

Random Tower

Gornova just keeps learning! There's quite often content here that amuses me. http://randomtower.blogspot.com/

Achroware

Jack mostly posts stuff on Twitter, but hey. http://achroware.com/

Kieran Patel

Kieran mostly posts stuff on Twitter, but hey. http://kieranajp.tumblr.com/

Kommander Klobb

Mr. Klobb is founder of Honeyslug and is one of the London indies.
http://klobb.posterous.com/

Oh, Games - Joe Bain

Joe has developed an Android game named Kaptilo, as well as an abstract game about catching birds. He's also one of the London indies.
http://ohgames.co.uk/

Not The Internet - George Buckenham

George is another of the London indies. He created "Hell is other people". Play it.
http://nottheinternet.com/