activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher G. Stach II" <...@ldsys.net>
Subject Re: Possible bug in activeMQ4.1.0 with Streams?
Date Tue, 30 Jan 2007 03:05:24 GMT
cafe wrote:
> I have a simple program that sends a stream to a queue, 
> 
> …
> OutputStream out = connection.createOutputStream(destination);
> 		
> 		File file = new File("D:/file.xml");
> 			
> 		FileInputStream fis = new FileInputStream(file);
> 		
> 		int l;
> 		byte[] array = new byte[1024];
> 		
> 		while ( (l = fis.read(array)) != -1  ){
> 			out.write(array);
> 		
> 		}
> 
> 
> 
> And in the other side a simple program who receive the stream:
> 
> 		InputStream fis = connection.createInputStream(destination);
> 		FileOutputStream out = new FileOutputStream("D:/Newfile.xml");
> 
> 		int l;
> 		byte[] array= new byte[1024];
> 		
> 		while ((l = fis.read(array)) > 0) {
> 			out.write(array);
> 		}
> 
> 
> The problem is that activeMQ is putting more bytes to the  stream, for
> example I have run these programs with the following input (file.xml):
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 
> And I obtain the following file (NewFile.xml)
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
_______ 
> 
> note: the line above are the byte added by activeMQ
> 
> What could be this?
> 
> 

You're using the wrong ``write'' method.

-- 
Christopher G. Stach II


Mime
View raw message