Show your code, so we can better understand what you're talking about. Generally speaking though, you do not need a "dynamic array", you need to use your "static array" properly.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Maybe you need something like this:
InputStream in = zipFile.getInputStream();
OutputStream out = new FileOutputStream(new File("a.bin"));
byte buf[] = new byte[1024 * 8]; /* declare a 8kB buffer */
int len = -1;
while((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
That is not "converting" an InputStream to anything. That is reading an inputstream and storing (rather inefficiently) all of the read bytes into an array. Better would be to read it, and write it to a ByteArrayOutputStream and then simply get the bytes from that.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Nevermind, I am not going to get into an argument over "half-knowledge" and spoonfeeding.
Edit: Especially in a thread that is over two years dead. And by "not going to into detail" I assume you mean that I ddin't spoonfeed code. I wanted to see his code, first. It was, after all, his job to do, not mine.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494