| | |
Regarding byte arrays
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Friends,
I am stuck here , I am downloading some files from a url uing GZIPInputStream.I need to store this files.So i declared a bytearray with specified length.As i am downloading files with different size, i think i need to declare a dynamic byte array.
Please help me to solve these issue.
Thank You
I am stuck here , I am downloading some files from a url uing GZIPInputStream.I need to store this files.So i declared a bytearray with specified length.As i am downloading files with different size, i think i need to declare a dynamic byte array.
Please help me to solve these issue.
Thank You
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.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Maybe you need something like this:
java Syntax (Toggle Plain Text)
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); }
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Similar Threads
- C++ Byte arrays (C++)
- What relation does **indirection operator have with Multidimensional Arrays (C++)
- Pascal to VB (Pascal and Delphi)
- FTP Delivery Client (Pascal and Delphi)
- Where is System.Text.Encoding.EBCDIC? (C#)
- Multiple inputs for char / arrays of arrays (C++)
- Sorting arrays of pointers with function? (C)
- Comparing arrays (C++)
Other Threads in the Java Forum
- Previous Thread: Problem with line of source code,help please?
- Next Thread: threads
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application arc arguments array arrays automation binary bluetooth c++ chat class classes client code codesnippet component csv database doctype draw ebook eclipse encode error event exception file fractal freeze game givemetehcodez graphics gui helpwithhomework html ide image input integer intellij iphone j2me java java.xls javaprojects jmf jni jpanel julia linux list loop loops mac map method methods mobile netbeans newbie number online oracle page parameter print problem program programming project recursion reporting rotatetext scanner screen server set size sms socket sort sql string superclass swing system template test testautomation threads time title tree tutorial-sample windows working






