M
Max
Hello ,
I have i byte[] of 120KByte ;
this byte[] is an Image in JPEG format .
I want to display this image on the video but I can't convert the byte[] in
BufferedImage :-(
I have try in this way :
// get the 100KByte of image as byte[]
byte[] message = this.returnMyImageAsByte();
long size = 100*1024;
// create new FileInputStream
FileInputStream myI = new FileInputStream (new FileDescriptor());
// popolate the byte[] , 100*1024byte is the size of image !
myI.read(message,0, size);
// create bufferedImage
BufferedImage myBI = ImageIO.read(myI);
=======================================
the crash is that myI.read() accept
(byte[] , int , int) // RIGHT !
but 100*1024 is a long
(byte[], int , long) // WRONG !
In witch way i can show the image ??!
best regard,
max
I have i byte[] of 120KByte ;
this byte[] is an Image in JPEG format .
I want to display this image on the video but I can't convert the byte[] in
BufferedImage :-(
I have try in this way :
// get the 100KByte of image as byte[]
byte[] message = this.returnMyImageAsByte();
long size = 100*1024;
// create new FileInputStream
FileInputStream myI = new FileInputStream (new FileDescriptor());
// popolate the byte[] , 100*1024byte is the size of image !
myI.read(message,0, size);
// create bufferedImage
BufferedImage myBI = ImageIO.read(myI);
=======================================
the crash is that myI.read() accept
(byte[] , int , int) // RIGHT !
but 100*1024 is a long
(byte[], int , long) // WRONG !
In witch way i can show the image ??!
best regard,
max