tags:

views:

13

answers:

1

How i can seperate data got from server that either it is text or image ?i want to implement it in j2me.

A: 

If You retrieve the data form a stream

Example for GIF

public static boolean isGif(InputStream stream) {
 byte[] signature = new byte[3];
  stream.read(signature);
  stream.unread(signature);

return signature[0] == 'G' && signature[1] == 'I' && signature[2] == 'F';
}
Vash