[jcifs] File Size limitation

Michael B. Allen miallen at eskimo.com
Fri Aug 16 04:29:12 EST 2002


I  believe  all  Java streams use longs which are 64 bits in Java. I do not
believe  there  would be much modification necessary to the jCIFS source to
support  64  bit  offsets and in fact the API uses long. I'll add it to the
todo  and do an eval of the issue soon. The issue may have been that I just
didn't  feel  like  waiting  long enough to test the code. How long does it
take to transfer a >4G file? Will you test my modifications? 


On Thu, 15 Aug 2002 10:23:35 -0700
John Kudrle <johnk at telestream.net> wrote:

> 
> 	Hello,
> 
> 	We are using jcifs for accessing/reading network files.  It appears
> that files which are > 4GB encounter problems.  I took a quick look at the
> source and see that the SmbFileInputStream inherits from the
> java.io.InputStream.  Do you know if this 4GB limit is a limitation of the
> java.io.InputStream?  I hope this is not a "duplicate" question you are
> asked alot; I checked your FAQ and did not see any text regarding file size
> limitations.
> 
> 	Below is a quick snippet of the reader code we are using:
> 
> 	.
> 	.
> 	.
> 			FileOutputStream out = new FileOutputStream (local);
> 			.
> 			.
> 			.
>      			jcifs.smb.SmbFile file = new jcifs.smb.SmbFile
> (url);
> 				
> 			jcifs.smb.SmbFileInputStream in = new
> jcifs.smb.SmbFileInputStream (file);
> 		
> 			//	transfer file
> 
> 			byte[] data = new byte[64000];
> 				
> 			long total = 0;
> 					
> 			int length = in.read (data);
> 
> 			while (length > 0)
> 			{
> 				out.write (data, 0, length);
> 
> 				total += (long)length;
> 						
> 				session.setCurrent (total);
> 						
> 				length = in.read (data);
> 			}
> 
> 	With files > 4GB; the in.read(data) method never hits the eof
> condition.  It will keep reading until the out.write() method generates an
> exception due to disk space.
> 
> 	Thanks for any information/insight you may have,
> 
> 	John
> 
> 
> 	John Kudrle
> 	Telestream, Inc.
> 
> 	530-470-1317
> 


-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and more importantly to tasks that have not
yet been conceived. 



More information about the jcifs mailing list