I would like to send an encrypted image over UDP, for that reason I would like to encrypt the image without compression using RC4. The reason I don't want compression is because I don't want the errors to multiply.
I am looking for a way to transform the image from BufferedImage to byte array without compression.
Asked
Active
Viewed 48 times
0

user5588938
- 13
- 5
-
@HarryHarrison Can you give me a little bit more information about DataBufferByte since the oracle docs are not enough? For bufferedimages ill it store in an array the bytes for RGB for every pixels? – user5588938 Nov 21 '15 at 12:37
-
How is DataBufferByte even related to this question? You need to explain further and improve the quality of your question – Harry Harrison Nov 21 '15 at 12:40
-
@HarryHarrison DataBufferByte is used in the question you linked in the comments above – user5588938 Nov 21 '15 at 12:42
-
Sorry, didn't spot that in the other question as it's part of the attempt presented in the question which would be replaced by the code in the answer. – Harry Harrison Nov 21 '15 at 12:46
-
I would say you have two questions here – Daniel Alder Nov 21 '15 at 12:46
-
@HarryHarrison The proposed answer `ImageIO.write(img, "jpg", baos);` compresses to jpg I think, so I do not want to use it. – user5588938 Nov 21 '15 at 12:48
-
@DanielAlder You were right my question was confusing, I edited it now. – user5588938 Nov 21 '15 at 12:55
-
@user5588938 - "jpg" is not the only possible value for that parameter – Harry Harrison Nov 21 '15 at 14:16