| Author |
Create a byte array from a image file
|
ram ragu
Ranch Hand
Joined: Mar 12, 2002
Posts: 57
|
|
Hello, I am totally new to java and I just wanted to know how to create a byte array from an image file i.e i have a test.gif on my local drive (c:/test.gif) It might be simple .. but i just started learning java.. but need to do this rightaway .. let me know.
|
 |
Jason Ford
Ranch Hand
Joined: Aug 02, 2001
Posts: 54
|
|
If you want to create a byte array from a file, you just need to read in the file and store the result to an array: If you really want a byte array instead of the char array, create a String with the char array and use the getBytes method on the String. Unless I'm missing something... HTH, Jason
|
SCJP, SCWCD
|
 |
hennie louw
Ranch Hand
Joined: Jul 03, 2001
Posts: 56
|
|
That might work but you can also try this I'm just not sure if {array}.length value is the length of the array or the number of the last reffrence , but goo luck
|
Any Body can be paid to write good code, but brilliant code can only come from passion
|
 |
 |
|
|
subject: Create a byte array from a image file
|
|
|