开发者

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

开发者 https://www.devze.com 2023-01-15 20:46 出处:网络
How i can seperate data got from server that either it is text or image ?i want to implement it in j2开发者_开发技巧me.If You retrieve the data form a stream

How i can seperate data got from server that either it is text or image ?i want to implement it in j2开发者_开发技巧me.


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';
}
0

精彩评论

暂无评论...
验证码 换一张
取 消