|
-
April 8th, 2008, 08:47 AM
#1
Raster/DataBuffer via network ?
Hi there,
I got the following problem.
I created a small client-server architecture. The server reads images from a webcam. Now a client can open a connection to the server and request an actual image to be sent his way. So far this works all right. Only that, at the moment, I am using object streams to do that (sending an Image object).
But what I´d like to do is converting the Image to a BufferedImage (which also works already) and then send the raw data via the network (Raster->DataBuffer). But I sincerely have now idea how to do that. How do I go about writing and reading such files/data?
I actually don´t know if that will be faster or better. Or if there is an even better way to do that.
Any help is greatly appreciated. I am pretty new to Java.
Oceansoul
-
April 9th, 2008, 06:22 PM
#2
Re: Raster/DataBuffer via network ?
Well... have you tried just calling BufferedImage.getData() , sending the returned Raster object the same way you are sending the Image object now, then calling the setData() method on the BufferedImage on the client side?
-
April 10th, 2008, 07:41 AM
#3
Re: Raster/DataBuffer via network ?
Hm, actually no. I´ll give that a try.
While searching for info in the web I came acrosse several code snippets regarding similar topics. And those seemed to suggest to do the streaming byte-wise (stream.writeByte() ...). So I assumed that was the way to go. Only I couldn´t adapt it to my specific problem (as described above).
Thanks.
Oceansoul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|