C#µ½Java byteÀàÐͳåÍ»µÄ½â¾ö
×î½üÒª¸Äдһ¸öºËÐļÓÃÜÈÏÖ¤À࣬´ÓC#¸Äд³ÉJava¡£
·¢ÏÖÔÚµ÷ÊÔʱ£¬¼ÓÃܵÄÊý¾ÝÎÞÂÛÈçºÎÒ²¶Ô²»ÉÏ¡£
¾¹ý¸ú×Ù£¬·¢ÏÖÎÊÌâ³öÔÚC#ºÍJava byteÀàÐ͵ÄÇø±ðÉÏ£ºÔÚC#Àï byteÀàÐÍÊÇÎÞ·ûºÅµÄ£¬¶øJavaÀïÊÇÓзûºÅµÄ£¬ËùÒÔC#ÀïµÄ129µ½JavaÀï¾Í³ÉÁ˸ºÊý¡£
·¢ÏÖÁËÎÊÌ⣬½â¾ö¾Í±È½ÏÈÝÒ×ÁË£¬Õë¶ÔJavaµÄbyte£¬²ÉÓÃIntÀ´½øÐд洢¡£
ͨ¹ýÈçÏ´úÂë´Óbyteµ½int½øÐÐת»»£º
/**
* from byte to int, because of byte in java is signed
*/
private static int toInt(int b) {
return b >= 0 ? (int)b : (int)(b + 256);
}
¶ÔÓÚÏÂÃæC#µÄ´úÂ룺
private static AuthenticationTicket fromByteArray(byte[] buf)
{
MemoryStream ms = new MemoryStream(buf);
BinaryReader reader = new BinaryReader(ms);
short version = reader.ReadInt16();
short scope = reader.ReadInt16();
int key = reader.ReadInt32();
}
¸ÄдΪÈçÏÂÐÎʽ£¬Ï൱ÓÚÖØÐÂʵÏÖBinaryReaderµÄReadInt16ºÍReadInt32·½·¨¡£
private static AuthenticationTicket fromByteArray(int[] bufInt)
{
int version = readInt16(bufInt);
int scope = readInt16(bufInt);
long key = readInt32(bufInt);
}
private static int readInt16(int[] bufInt) {
int i = 0;
for(int j = 0; j < 2; readArrayIndex++, j++) {
i += bufInt[readArrayIndex] << (j << 3);
}
return i;
}
private static long readInt32(int[] bufInt) {
long i = 0;
for(int j = 0; j < 4; readArrayIndex++, j++) {
i += bufInt[readArrayIndex] << (j << 3);
}
return i;
}
ÉÏÃæµÄÀý×Ó˵Ã÷£¬c#ºÍJavaËäÈ»·Ç³£ÏàÏñ£¬µ«ÊÇһЩ¹Ø¼üϸ½ÚµÄ²»Í¬ÊÇÐèÒª×Ðϸ¿¼Âǵġ£
Ïà¹ØÎĵµ£º
1.ÔÚÄã¾õµÃÓдíµÄµØ·½ÉèÖöϵã
2.µã»÷¼×¿Ç³æÒ»ÑùµÄ°´Å¥ÏÂÃæµÄ×Ó°´Å¥£¬Ò²ÊǼ׿dzæÒ»ÑùµÄ£¬½ÐDebug
3.ÔËÐгÌÐò£¬µ±³ÌÐòÔËÐе½¸Õ²ÅÉèÖöϵãµÄλÖþͻáÍ£ÏÂÀ´£¬²¢ÇÒÄÇÐдúÂëµ×É«»á¸ßÁÁÏÔʾ¡£
4.½Ó×ÅÄãÔÚÈçϽçÃæÄã¿ÉÒÔ¿´µ½ÄãÏëÒªµÄÐÅÏ¢
5.ÔÚVariablesÀïÃæ¿ÉÒԲ鿴ËùÓбäÁ¿µÄÖµ£¬±ÈÈç¸Õ²ÅÉèÖõĶϵãÀïÃæµÄstrClassNameµÄÖµ¾Í ......
var ProjectName = document.getElementById("<%=ProjectName.ClientID%>").innerText;
ProjectName = ProjectName.replace(/(^\s*)|(\s*$)/g, ""); // Ï൱ÓÚTrim()º¯Êý ......
¹Ø¼ü×Ö: µ×²ãÊý¾Ý Ãû´Ê½âÊÍ£º ²¹Â룺1 ÔÚ¼ÆËã»úϵͳÖУ¬ÊýÖµÒ»ÂÉÓв¹ÂëÀ´±íʾ(´æ´¢). ʹÓò¹Âë,¿ÉÒÔ½«·ûºÅλºÍÆäËûλͳһ´¦Àí;ͬʱ,¼õ·¨Ò²¿É°´¼Ó·¨À´´¦Àí.ÁíÍâ,Á½¸öÓò¹Âë±íʾµÄÊý¾ÝÏà¼Óʱºò,Èç¹û×î¸ßλ(·ûºÅλ)Óнøλ,Ôò½øÎ¥±»ÉáÆú. 2 ²¹ÂëÓëÔÂëµÄת»»¹ý³Ì¼¸ºõÊÇÏàͬµÄ ÊýÖµµÄ²¹Âë±íʾҲ·ÖÁ½ÖÖÇé¿ö£º £¨1£©ÕýÊýµÄ²¹Âë:ÓëÔ ......
ƪÎÄÕÂÊÇ×î½ü¸Õ¿´µ½µÄ£¬ËäÈ»ÊÇ˵³ÌÐòÔ±´ÓC++תJAVAÐèҪעÒâµÄµØ·½£¬µ«ÊǺÜÏêϸµÄ˵³öÁËC++ºÍJAVAµÄ²»Í¬µÄµØ·½£¬¶ÔÓÚJAVAÖÐΪʲôûÓÐÖ¸Õ롢ΪʲôûÓÐÄÚ´æй¶¡¢½Ó¿ÚºÍC++ÖжàÖؼ̳еĹØϵ¡¢Òì³£»úÖƵÈÎÊÌâÒ²ÃèÊöµÄºÜÏêϸ£¬¹ÊתÔعýÀ´¡£
1.JavaÔÚÐéÄâ»úÉÏÔËÐÐ
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·Òë³ÉÎ ......
ÔÚSUNÍƳö LWUIT¿ª·¢°ü֮ǰ£¬ÔÚJava MEƽ̨ÉÏ¿ª·¢Óû§½çÃæ²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊ£¬ÓÈÆäÊÇÏë×ö³öºÜÑ£µÄ½çÃ棬¸üÊÇÄÑÉϼÓÄÑ£¬ÕâÊÇÒòΪÓÉMIDP±¾ÉíÌṩµÄÓû§½çÃæÔªËØ£¬°üjavax.microedition.lcdui
ÖÐÌṩµÄ×é¼þ¹¦ÄÜÏà¶Ô¼òµ¥¡£
ʹÓà LWUIT ¿ª·¢°ü£¬¿ª·¢ÈËÔ±²»ÔÙÐèÒª±àдÓëÉ豸ÆÁÄ»´óСÏà¹ØµÄ´úÂ룬Ëü²ÉÓÃÁËÓëSwing ÏàËƵĸÅÄîÌá ......