Reading an Image from Local drive and store to ByteArray
posted 5 years ago
I am working on a WebService that returns a Image from Server to Client. I followed different examples, and built a service that will reads a file from a URL and writes to a Byte Array.
Now i am looking for a way to read a file from local drive to ByteArray..i tried URL("c:\newimage.png") its not working..tried many ways from File to FileInputStream and BufferedInputStream to convert to bye array..nothing is working. Rest of code works only on ByteArray..i have to figure out a way to store an image from local directory to ByteArray....Please help Friends.