Skip to main content

Images over JXTA pipes

2 replies [Last post]
galato
Offline
Joined: 2007-07-06
Points: 0

Hi all,

have anyone tried to send images between peers across the jxta bidrectional pipes? I was wondering if anyone else has run into issues such as needing to break larger images into smaller ones. I am sending the JPEG images across after I read them into byte[] arrays ...

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
larrynorth
Offline
Joined: 2011-08-30
Points: 0

look at http://download.oracle.com/javase/6/docs/api/javax/imageio/package-summa...

ex:

OutputStream out = null;
try {
out = socket.getOutputStream();
ImageIO.write(bImage, "jpg", ou);
} catch (IOException ex){
ex.printStackTrace();
} finally {
if ( os != null ){
try { out.close(); } catch (IOException ex){}
}
}

easyly tested in socket tutorial.

galato
Offline
Joined: 2007-07-06
Points: 0

Hi,

Thanks Larry - good info, thanks. I was actually able to pass the images across using Base 64 encoding as strings. Not effient but since these are small images in size the penalty was not too much. What I found interesting is people telling me that JXTA cannot handle messages voer 16k when FYI that's wrong, I can 200k across without a hint of complaint. And fairly fast.

Cheers