This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

image in binary  RSS feed

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone tell me what should i do to get the image in binary format
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From where do you want to read the image? From File or From Database?
 
Dhanashree Mankar
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to pass a binary form of image from servlet to user Image is already stored on server

Originally posted by Ali Gohar:
From where do you want to read the image? From File or From Database?

 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still not understood
do you want to read the image file in form of byte[]?
 
Dhanashree Mankar
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ali Gohar:
Still not understood
do you want to read the image file in form of byte[]?


I want to convert the image in binary form i.e 10101 And need to send it in file
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But 'binary format' usually implies it already encoded as an image, which can be stored as file. You need to specify what the source of this 'binary data' is, and what the destination format is.
For example, if the image is stored on the harddrive of the server and you want to send it to the client, get a binary OutputStream from the request, set the mimeType to "image/imagetype" (eg image/jpeg), and pipe one to the other.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!