How i can seperate data got from server that either it is text or image ?i want to implement it in j2me.
views:
13answers:
1
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
2010-09-10 11:53:06