PiRSquared17 / tomproject

Automatically exported from code.google.com/p/tomproject
0 stars 0 forks source link

TomUtils.copyFile error #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
need to make a loop getting the remaining bytes to read at:
buffer = new byte[in.available()];

see avaialbe() method documetation.

Original issue reported on code.google.com by brito....@gmail.com on 30 Mar 2010 at 7:49

GoogleCodeExporter commented 9 years ago
Is there a native JDK code to copy files(buffers, streams, or whatever)?
http://stackoverflow.com/questions/2548306/native-jdk-code-to-copy-files

Original comment by brito....@gmail.com on 30 Mar 2010 at 8:06

GoogleCodeExporter commented 9 years ago
in.available javadoc:
"Note that while some implementations of  InputStream will return the total 
number of 
bytes in the stream, many will not. It is never correct to use the return value 
of 
this method to allocate a buffer intended to hold all data in this stream"

Original comment by brito....@gmail.com on 30 Mar 2010 at 8:15

GoogleCodeExporter commented 9 years ago
Solution: use the Apache Commons IO.

Original comment by brito....@gmail.com on 30 Mar 2010 at 10:42

GoogleCodeExporter commented 9 years ago

Original comment by brito....@gmail.com on 30 Mar 2010 at 10:51

GoogleCodeExporter commented 9 years ago

Original comment by brito....@gmail.com on 9 Apr 2010 at 12:39