»ñÈ¡ÆÕͨJava¶ÔÏó´óС
»º´æ¶ÔÏóÐèÒªÖªµÀ¶ÔÏóÕ¼ÓÿռäµÄ´óС,¿ÉÒÔÊÂÏÈÉèÖúÃÿÖÖÀàÐ͵ĴóС,´Ë·½·¨¶ÔÆÕͨµÄ¶ÔÏóÆðЧ,JiveÂÛ̳ÖеĶÔÏóÒ²ÊDzÉÓÃÕâÖÖ°ì·¨À´»ñÈ¡¶ÔÏóµÄ´óСµÄ(È¡×ÔJive).
public class CacheSizes {
/**
* Returns the size in bytes of a basic Object. This method should only
* be used for actual Object objects and not classes that extend Object.
*
* @return the size of an Object.
*/
public static int sizeOfObject() {
return 4;
}
/**
* Returns the size in bytes of a String.
*
* @param string the String to determine the size of.
* @return the size of a String.
*/
public static int sizeOfString(String string) {
if (string == null) {
return 0;
}
return 4 + string.length()*2;
}
/**
* Returns the size in bytes of a primitive int.
*
* @return the size of a primitive int.
*/
public static int sizeOfInt() {
return 4;
}
/**
* Returns the size in bytes of a primitive char.
*
* @return the size of a primitive char.
*/
public static int sizeOfChar() {
return 2;
}
/**
* Returns the size in bytes of a primitive boolean.
*
* @return the size of a primitive boolean.
*/
public static int sizeOfBoolean() {
return 1;
}
/**
* Returns the size in bytes of a primitive long.
*
* @return the size of a primitive long.
*/
public static int sizeOfLong() {
return 8;
}
/**
* Returns the size in bytes of a primitive double.
*
* @return the size of a primitive double.
*/
public static int sizeOfDouble() {
return 8;
}
/**
* Returns the size in bytes of a Date.
*
* @return the size of a Date.
*/
public static int sizeOfDate() {
return 12;
}
/**
* Returns the size in bytes of a Properties object
Ïà¹ØÎĵµ£º
1 ±³¾°
ÔÚÎÒÃǵÄÏîÄ¿ÖУ¬ÓÐʱºòÔÚÐèÒªÔËÐÐʱ»ñȡһ¶Î½Å±¾²¢Ö´ÐÐÆäÂß¼ÒÔÁé»îµØÊµÏÖÒµÎñÐèÇó¡£ÓÐÈ˵ĵÚÒ»Ïë·¨¾ÍÊǽű¾ÓïÑÔ£¬ÎÒÃǵ±È»¿ÉÒÔÔÚ³ÌÐòÖÐÄÚǶһ¸öPython½âÊÍÆ÷£¬È»ºóÔÚÐèÒªÁé»î±ä¶¯µÄµØ·½Ê¹ÓÃPython½Å±¾ÊµÏÖÎÒÃǵÄÂß¼¡£µ«ÊÇÕâÑù×öÌ«“ÖØÁ¿¼¶”ÁË£¬¿öÇÒÉíΪһ¸öJava³ÌÐòÔ±£¬Äã²»Ò»¶¨¶®µÃPythonµÄÓï·¨£¬ÓÖ ......
µ±Á½¸ö½ø³ÌÔÚ½øÐÐÔ¶³ÌͨÐÅʱ£¬±Ë´Ë¿ÉÒÔ·¢Ë͸÷ÖÖÀàÐ͵ÄÊý¾Ý¡£ÎÞÂÛÊǺÎÖÖÀàÐ͵ÄÊý¾Ý£¬¶¼»áÒÔ¶þ½øÖÆÐòÁеÄÐÎʽÔÚÍøÂçÉÏ´«ËÍ¡£·¢ËÍ·½ÐèÒª°ÑÕâ¸öJava¶ÔÏóת»»Îª×Ö½ÚÐòÁУ¬¼´Java¶ÔÏóÐòÁкţ¬²ÅÄÜÔÚÍøÂçÉÏ´«ËÍ£»½ÓÊÕ·½ÔòÐèÒª°Ñ×Ö½ÚÐòÁÐÔÙ»Ö¸´ÎªJava¶ÔÏ󣬼´·´ÐòÁл¯¡£
°ÑJava¶ÔÏóת»»Îª×Ö½ÚÐòÁеĹý³Ì³ÆÎª¶ÔÏóµÄÐòÁл¯¡£
°Ñ×Ö½ ......
ÎÒÃÇÖªµÀJavaÖÐÒ»°ãµÄÊäÈëÊä³öÁ÷Àà¶¼ÊÇÓõ¥×ֽڵĶÁÈ¡·½·¨À´½øÐÐI/O²Ù×÷µÄ£¬Ò²¾ÍÊÇ˵ÿ´ÎÖ»¶Áдһ¸ö×Ö½ÚµÄÊý¾Ý£¬ÕâÖÖ·½·¨ÏÔÈ»·±ËöµÍЧ¡£Èç¹û´ÓÉ豸¶ÁÈ¡10MµÄÎļþ£¬Ã¿´Î¶Áȡһ¸ö×Ö½Ú£¬Íê³É²Ù×÷½«ÐèÒª×ö10M/´ÎI/O²Ù×÷£¬I/O²Ù×÷ÓÖÊÇÒ»¼þÏ൱ºÄʱµÄÊÂÇ飬ÎÞÒÉÔںܴó³Ì¶ÈÉϽµµÍÁËϵͳµÄÐÔÄÜ¡£
JavaÖÐ× ......
×î½ü¸ãÒ»¸öÏîÄ¿ÐèÒª²Ù×÷Excel£¬googleÁËһϣ¬·¢ÏÖÓÐÁ½¸öµÚÈý·½¿ªÔ´Àà¿â£¬·Ö±ðÊÇJexcelºÍPoi¡£´ÖÂԵؿ´ÁËһϣ¬jexcelÄÚÈݲ»ÅӴ󣬾õ×ÅÎÒÖ»ÊÇÓÃһЩ»ù±¾µÄexcel¶Áд¹¦ÄÜ£¬ËüÓ¦¸ÃÄÜÂú×ãÒªÇó¡£ÏÂÃæ¼òÒªµÄ½éÉÜÒ»ÏÂÕâÁ½¸öÀà¿â¡£
jexcel£ºÔÚÓÃjexcelµÄ¹ý³ÌÖз¢ÏÖ¶ÁµÄËÙ ......
ǰһ¶Îʱ¼äÊÔ×ÅÓÃÕâÈýÖÖÓïÑÔ¼òµ¥µÄдÁ˹ØÓÚÎļþ¿½±´µÄ³ÌÐò£¬·¢ÏÖc#ºÍpythonµÄapi¾ªÈ˵ÄÏàËÆ£¬¶ÔÓÚÎļþµÄ²Ù×÷ÕâÁ½ÖÖÓïÑԷdz£µÄ·½±ã¡£¶¼Ã»ÓмÓÒì³£µÄ´¦Àí
C#Ô´´úÂ룺
public static void CopyFile(string source, string destination)
& ......