0

I'm writing a java HTTP server and required to be able to return the favicon.ico. the problem is I don't know how to read and write it to the socket output stream since it is not supported by ImageIO. Any ideas?

The Badge
  • 38
  • 2
  • 7
  • 2
    Why don't you create a static `favicon.ico` file and just serve that? It's going to be cached by your site visitor(s) anyway. – Elliott Frisch Dec 02 '13 at 01:57

1 Answers1

1

You don't need ImageIO for this. Just transfer the bytes, same as for any other static resource. That applies to all static resources. You don't need to make this a special case in any way.

user207421
  • 305,947
  • 44
  • 307
  • 483