• Post Reply Bookmark Topic Watch Topic
  • New Topic

ArrayIndexOutOfBounds Exception on OutputSteam write()  RSS feed

 
Jason Ferguson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is probably a simple one, but the following chunk of code keeps throwing ArrayIndexOutOfBoundsException on the outputStream.write(buffer, 0, size) line.



Anyone see my error?

Jason
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything obvious, but why aren't you writing the byte array to the output stream with a single write call?
 
Jason Ferguson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uh, because I really don't know what I'm doing and the code I stole this from used the buffer?

Seriously, thanks for pointing this out.

Jason

Originally posted by Joe Ess:
I don't see anything obvious, but why aren't you writing the byte array to the output stream with a single write call?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!