Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InputStream into byte array

 
Dean Reedy
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to read a text file into a byte array. How could I do this.
For example I have a byte array called buffer, I have opened a InputStream "is" and I am reading it in one byte at a time. Now how do I append or add the int "c" into the byte array called "buffer"? Any better ideas would be great.
byte [] buffer;
int c;
while ( c = is.read() != -1 )) {
???
}
thanks,
Dean
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic