{"id":1500,"date":"2019-03-18T14:30:33","date_gmt":"2019-03-18T05:30:33","guid":{"rendered":"https:\/\/www.bold.ne.jp\/engineer-club\/?p=1500"},"modified":"2025-10-06T17:23:57","modified_gmt":"2025-10-06T08:23:57","slug":"java-byte","status":"publish","type":"post","link":"https:\/\/www.bold.ne.jp\/engineer-club\/java-byte","title":{"rendered":"Java\u306ebyte\u3068\u306f\uff1fbyte\u3068\u57fa\u672c\u30c7\u30fc\u30bf\u578b\u30fb\u6587\u5b57\u5217\u306e\u5909\u63db\u3092\u8a73\u7d30\u306b\uff01"},"content":{"rendered":"<p><strong>Java\u306ebyte\u306f\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e\u4e00\u3064\u3067\u30018\u30d3\u30c3\u30c8\u306e\u7bc4\u56f2\u3067-128\uff5e127\u307e\u3067\u306e\u6574\u6570\u3092\u8868\u73fe\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/strong><\/p>\n<p>byte\u306f\u4e3b\u306b\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3084\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u3092\u6271\u3046\u6642\u306b\u4f7f\u3044\u307e\u3059\u3002\u4eba\u306b\u3088\u3063\u3066\u306f<span>byte<\/span>\u306f\u4f7f\u3063\u305f\u3053\u3068\u304c\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001<span>Java 9<\/span>\u4ee5\u964d\u306e<span>String<\/span>\u306f\u5185\u90e8\u7684\u306b<span>byte<\/span>\u3067\u6587\u5b57\u5217\u3092\u7ba1\u7406\u3057\u3066\u3044\u307e\u3059\u3057\u3001\u5b9f\u306f<span>byte<\/span>\u306f\u7d50\u69cb\u8eab\u8fd1\u306b\u3042\u308b\u306e\u3067\u3059\u3002<\/p>\n<p>\u3067\u3059\u304b\u3089\u3001<span>byte<\/span>\u306e\u6271\u3044\u65b9\u3084\u8003\u3048\u65b9\u3092\u77e5\u3063\u3066\u304a\u304f\u3068\u3001\u3044\u3056\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u3092\u6271\u308f\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u304f\u306a\u3063\u305f\u6642\u306b\u614c\u3066\u305a\u306b\u6e08\u307f\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u306e\u6271\u3044\u304c\u5206\u304b\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306e\u52d5\u304d\u65b9\u306e\u7406\u89e3\u306b\u4e00\u6b69\u8fd1\u3065\u304f\u3053\u3068\u3067\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f<span>byte<\/span>\u306b\u3064\u3044\u3066\u3001<span><\/span><span class=\"f-marker-p\"><span>byte<\/span>\u3068\u306f\u3069\u3046\u3044\u3046\u3082\u306e\u304b<\/span>\u3001<span class=\"f-marker-p\">\u3069\u3046\u3084\u3063\u3066\u4f7f\u3046\u306e\u304b<\/span>\u3001<span class=\"f-marker-p\">\u6c17\u3092\u4ed8\u3051\u305f\u3044\u6240<\/span>\u306a\u3069\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<span>2<\/span>\u9032\u6570\u306b\u307e\u3064\u308f\u308b\u8a71\u304c\u3069\u3046\u3057\u3066\u3082\u591a\u3044\u3067\u3059\u304c\u3001\u305d\u3053\u3082\u5206\u304b\u308a\u3084\u3059\u304f\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<\/p>\n<p>\u203b\u3053\u306e\u8a18\u4e8b\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u3001<span>Java 11<\/span>\u306e\u74b0\u5883\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Javabyte1\">\uff11\uff0e\u3010Java\u3011byte\u306f1\u30d0\u30a4\u30c8\u3092\u8868\u3059\u30c7\u30fc\u30bf\u578b<\/a><ul><li><a href=\"#-Javabyte-128127\">\uff11-\uff11\uff0eJava\u306ebyte\u306f-128\uff5e127\u306e\u6574\u6570<\/a><\/li><li><a href=\"#-byte\">\uff11-\uff12\uff0ebyte\u306e\u4f7f\u3044\u3069\u3053\u308d\u306f\u30c7\u30fc\u30bf\u3092\u30d0\u30a4\u30ca\u30ea\u3067\u6271\u3046\u6642<\/a><\/li><\/ul><\/li><li><a href=\"#byte\">\uff12\uff0ebyte\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/a><ul><li><a href=\"#-byte-2\">\uff12-\uff11\uff0ebyte\u306e\u5ba3\u8a00\u306e\u4ed5\u65b9\u3001\u521d\u671f\u5024\u3001\u30ea\u30c6\u30e9\u30eb<\/a><\/li><li><a href=\"#-byte-3\">\uff12-\uff12\uff0ebyte\u3092\u4f7f\u3063\u305f\u56db\u5247\u6f14\u7b97<\/a><\/li><li><a href=\"#-byte-4\">\uff12-\uff13\uff0ebyte\u3067\u306e\u30d3\u30c3\u30c8\u6f14\u7b97<\/a><\/li><\/ul><\/li><li><a href=\"#byte-2\">\uff13\uff0ebyte\u3068\u4ed6\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u3068\u306e\u5909\u63db<\/a><ul><li><a href=\"#-shortcharintlongbyte\">\uff13-\uff11\uff0eshort\/char\/int\/long\u2192byte\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/a><\/li><li><a href=\"#-byteshortcharintlong\">\uff13-\uff12\uff0ebyte\u2192short\/char\/int\/long\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/a><\/li><li><a href=\"#-floatdoublebyte\">\uff13-\uff13\uff0efloat\/double\u2192byte\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/a><\/li><li><a href=\"#-bytefloatdouble\">\uff13-\uff14\uff0ebyte\u2192float\/double\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/a><\/li><li><a href=\"#-byte0255IntegertoUnsignedInt\">\uff13-\uff15\uff0e\u3010\u5fdc\u7528\u3011byte\u30920\uff5e255\u3067\u6271\u3044\u305f\u3044\u5834\u5408\u306f\u3001Integer.toUnsignedInt\u304b\u30d3\u30c3\u30c8\u6f14\u7b97\u3092\u4f7f\u304a\u3046<\/a><\/li><\/ul><\/li><li><a href=\"#byteString\">\uff14\uff0ebyte\u3068String\u3068\u306e\u5909\u63db<\/a><ul><li><a href=\"#-Stringbyte\">\uff14-\uff11\uff0eString\u2192byte\u306e\u5909\u63db<\/a><\/li><li><a href=\"#-byteString\">\uff14-\uff12\uff0ebyte\u2192String\u306e\u5909\u63db<\/a><\/li><li><a href=\"#-byteString-2\">\uff14-\uff13\uff0ebyte\u914d\u5217\u2192String\u306e\u5909\u63db<\/a><\/li><\/ul><\/li><li><a href=\"#byteByte\">\uff15\uff0ebyte\u3068Byte<\/a><ul><li><a href=\"#i\">\uff15-\uff11\uff0e\u4e8c\u7a2e\u985e\u306e\u8868\u73fe\u65b9\u6cd5\u306f\u6027\u80fd\u78ba\u4fdd\u306e\u305f\u3081<\/a><\/li><li><a href=\"#-Bytenull\">\uff15-\uff12\uff0e\u30af\u30e9\u30b9\u306eByte\u306a\u3089null\u3092\u8868\u73fe\u3067\u304d\u308b<\/a><\/li><li><a href=\"#-byteByte\">\uff15-\uff13\uff0e\u30aa\u30fc\u30c8\u30dc\u30af\u30b7\u30f3\u30b0\u3067byte\u3068Byte\u3092\u81ea\u52d5\u5909\u63db\u3059\u308b<\/a><\/li><li><a href=\"#-byte-5\">\uff15-\uff14\uff0e\u3010\u5fdc\u7528\u3011\u7b26\u53f7\u306a\u3057byte\u3068\u3057\u3066\u306e\u6271\u3044\u65b9<\/a><\/li><\/ul><\/li><li><a href=\"#i-2\">\uff16\uff0e\u307e\u3068\u3081<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Javabyte1\">\uff11\uff0e\u3010Java\u3011byte\u306f<span>1<\/span>\u30d0\u30a4\u30c8\u3092\u8868\u3059\u30c7\u30fc\u30bf\u578b<\/span><\/h2>\n<p><strong>byte\u306f\u6574\u6570\u306e\u30c7\u30fc\u30bf\u578b\u3067\u3001\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b(primitive\u3001\u57fa\u672c\u30c7\u30fc\u30bf\u578b)\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u306e\u4e00\u3064\u3067\u3059\u3002\u4e00\u3064\u306ebyte\u306e\u30b5\u30a4\u30ba\u306f8\u30d3\u30c3\u30c8(1\u30d0\u30a4\u30c8)\u3067\u3001Java\u3067\u306f\u3082\u3063\u3068\u3082\u30d3\u30c3\u30c8\u306e\u30b5\u30a4\u30ba\u304c\u5c0f\u3055\u3044\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u3067\u3059\u3002<\/strong><\/p>\n<p>byte\u3092\u4ed6\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u3068\u7c21\u5358\u306b\u6bd4\u8f03\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<table border=\"1\" style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr style=\"height: 48px;\">\n<th style=\"width: 16.6667%; height: 48px; border-color: #000000;\">\u30c7\u30fc\u30bf\u578b<\/th>\n<th style=\"width: 16.6667%; height: 48px; border-color: #000000;\">\u5024\u306e\u7a2e\u985e<\/th>\n<th style=\"width: 16.6667%; height: 48px; border-color: #000000;\">\u30d3\u30c3\u30c8\u6570<\/th>\n<th style=\"width: 16.6667%; height: 48px; border-color: #000000;\">\u8868\u73fe\u3067\u304d\u308b\u5024\u306e\u7bc4\u56f2<\/th>\n<th style=\"width: 16.6667%; height: 48px; border-color: #000000;\">\u63a5\u5c3e\u8a9e<\/th>\n<th style=\"width: 16.6667%; height: 48px; border-color: #000000;\">\u5099\u8003<\/th>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">boolean<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u771f\u507d\u5024<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">1\u30d3\u30c3\u30c8<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">true\/false\u306e\u3069\u3061\u3089\u304b<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">&#8211;<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">byte<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u6574\u6570<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">8\u30d3\u30c3\u30c8(1\u30d0\u30a4\u30c8)<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">-128\uff5e<span>127<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">&#8211;<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">short<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u6574\u6570<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">16\u30d3\u30c3\u30c8(2\u30d0\u30a4\u30c8)<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">-32,768\uff5e<span>32,767<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">&#8211;<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">char<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u6587\u5b57<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">16\u30d3\u30c3\u30c8(2\u30d0\u30a4\u30c8)<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">0\uff5e<span>65,535<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">&#8211;<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">Unicode\u6587\u5b57\u3001<span>\\u0000<\/span>\uff5e<span>\\uffff<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">int<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u6574\u6570<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">32\u30d3\u30c3\u30c8(4\u30d0\u30a4\u30c8)<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">-2,147,483,648\uff5e<br \/>\n2,147,483,647<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">&#8211;<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u7d04<span>\u00b121<\/span>\u5104<span>4<\/span>\u5343<span>7<\/span>\u767e\u4e07\u3001<span>Unicode<\/span>\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">long<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u6574\u6570<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">64\u30d3\u30c3\u30c8(8\u30d0\u30a4\u30c8)<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">-9,223,372,036,854,775,808\uff5e<br \/>\n<span>9,223,372,036,854,775,807<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">L\u307e\u305f\u306f<span>l<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u7d04<span>\u00b1922<\/span>\u4eac<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">float<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u6d6e\u52d5\u5c0f\u6570\u70b9<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">32\u30d3\u30c3\u30c8(4\u30d0\u30a4\u30c8)<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u00b13.40282347E+38\uff5e<span> 1.40239846E-45<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">F\u307e\u305f\u306f<span>f<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u5358\u7cbe\u5ea6<br \/>\n\u7d04<span>\u00b13.4\u00d710<\/span>\u306e<span>38<\/span>\u4e57\uff5e\u7d04<span>\u00b11.4\u00d710<\/span>\u306e<span>-45<\/span>\u4e57<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">double<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u6d6e\u52d5\u5c0f\u6570\u70b9<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">64\u30d3\u30c3\u30c8(8\u30d0\u30a4\u30c8)<\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\u00b11.79769313486231570E+308\uff5e<span>\u00b14.94065645841246544E-324<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">D\u307e\u305f\u306f<span>d<\/span><\/td>\n<td style=\"width: 16.6667%; height: 24px; border-color: #000000;\">\n<p>\u500d\u7cbe\u5ea6<br \/>\n\u7d04<span>\u00b11.8\u00d710<\/span>\u306e<span>308<\/span>\u4e57\uff5e\u7d04<span>\u00b14.9\u00d710<\/span>\u306e<span>-324<\/span>\u4e57<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span id=\"-Javabyte-128127\">\uff11-\uff11\uff0eJava\u306e<span>byte<\/span>\u306f<span>-128<\/span>\uff5e<span>127<\/span>\u306e\u6574\u6570<\/span><\/h3>\n<p>Java\u306e<span>byte<\/span>\u3067\u306f\u3001<span>-128<\/span>\uff5e<span>127<\/span>\u306e\u6574\u6570\u3092\u8868\u73fe\u3067\u304d\u307e\u3059\u3002\u6574\u6570\u3067\u3059\u306e\u3067\u3001\u6570\u5024\u306f<span>1<\/span>\u305a\u3064\u5909\u5316\u3057\u3001\u5c0f\u6570\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<span>byte<\/span>\u306f<span>8<\/span>\u30d3\u30c3\u30c8\u306a\u306e\u3067<span>2<\/span>\u306e<span>8<\/span>\u4e57\u3068\u304a\u308a\u3001\u3059\u306a\u308f\u3061<span>256<\/span>\u3068\u304a\u308a\u3092\u8868\u73fe\u3067\u304d\u307e\u3059\u3002\u305d\u306e\u534a\u5206\u3092\u30de\u30a4\u30ca\u30b9\u306e\u6574\u6570\u3068\u3057\u3066\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>byte\u306e<span>8<\/span>\u30d3\u30c3\u30c8\u306e\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3068\u3001\u5b9f\u969b\u306e\u6570\u5024\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5bfe\u5fdc\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001<span>byte<\/span>\u3092<span>+1<\/span>\u3057\u7d9a\u3051\u308b\u3068<span>-128<\/span>\uff5e<span>127<\/span>\u306e\u7bc4\u56f2\u3092\u3050\u308b\u3050\u308b\u56de\u308b\u306e\u3067\u3059\u3002<\/p>\n<table border=\"1\" style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<th style=\"width: 25%; height: 24px; border-color: #000000;\">5\uff5e8\u30d3\u30c3\u30c8\u76ee<\/th>\n<th style=\"width: 25%; height: 24px; border-color: #000000;\">1\uff5e4\u30d3\u30c3\u30c8\u76ee<\/th>\n<th style=\"width: 25%; height: 24px; border-color: #000000;\">10\u9032\u6570\u8868\u73fe<\/th>\n<th style=\"width: 25%; height: 24px; border-color: #000000;\">\u5099\u8003<\/th>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0000<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0000<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">\u3059\u3079\u3066\u306e\u30d3\u30c3\u30c8\u304c0<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0000<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0001<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0000<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0010<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">2<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\" colspan=\"4\">\u2026<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0111<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1110<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">126<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0111<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1111<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">127<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">Byte.MAX_VALUE<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1000<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0000<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">-128<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">Byte.MIN_VALUE<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1000<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">0001<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">-127<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\" colspan=\"4\">\u2026<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1111<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1110<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">-2<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1111<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">1111<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">-1<\/td>\n<td style=\"width: 25%; height: 24px; border-color: #000000;\">\u3059\u3079\u3066\u306e\u30d3\u30c3\u30c8\u304c<span>1<\/span>\u3001<span>+1<\/span>\u3059\u308b\u3068<span>0<\/span>\u306b\u623b\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>byte\u306f<span>0<\/span>\u304b\u3089\u59cb\u307e\u3063\u3066<span>1<\/span>\u305a\u3064\u5927\u304d\u304f\u306a\u308a\u3001<span>8<\/span>\u30d3\u30c3\u30c8\u76ee\u304c<span>0<\/span>\u304b\u3064<span>1<\/span>\uff5e<span>7<\/span>\u30d3\u30c3\u30c8\u76ee\u304c\u5168\u3066<span>1<\/span>\u306b\u306a\u308b\u3068<span>127<\/span>\u3067\u3059\u3002\u305d\u3053\u304b\u3089\u3001<span>8<\/span>\u30d3\u30c3\u30c8\u76ee\u304c<span>1<\/span>\u304b\u3064<span>0<\/span>\uff5e<span>7<\/span>\u30d3\u30c3\u30c8\u76ee\u304c\u5168\u3066<span>0<\/span>\u306b\u306a\u308b\u3068<span>-128<\/span>\u3067\u3001\u305d\u3053\u304b\u3089<span>1<\/span>\u305a\u3064\u5927\u304d\u304f\u306a\u308a\u3001\u5168\u3066\u306e\u30d3\u30c3\u30c8\u304c<span>1<\/span>\u306b\u306a\u308b\u3068<span>-1<\/span>\u3067\u3059\u3002<\/p>\n<h3><span id=\"-byte\">\uff11-\uff12\uff0ebyte\u306e\u4f7f\u3044\u3069\u3053\u308d\u306f\u30c7\u30fc\u30bf\u3092\u30d0\u30a4\u30ca\u30ea\u3067\u6271\u3046\u6642<\/span><\/h3>\n<p>byte\u306f\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3084\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u3092\u300c\u305d\u306e\u307e\u307e\u300d\u6271\u3046\u6642\u306b\u4f7f\u3044\u307e\u3059\u3002\u3082\u3061\u308d\u3093\u3001<span>byte<\/span>\u306f\u6570\u5024\u578b\u306a\u306e\u3067<span>byte<\/span>\u3092\u4f7f\u3063\u305f\u8a08\u7b97\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u304b\u3089\u306e\u6271\u3044\u306f\u30c7\u30fc\u30bf\u306e\u683c\u7d0d\u5bb9\u5668\u3067\u3042\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3067\u3059\u304b\u3089\u3001<span>byte<\/span>\u306e\u5909\u6570\u3092<span>1<\/span>\u3064\u3060\u3051\u4f7f\u3046\u3088\u308a\u3082\u3001<span>byte<\/span>\u3092\u914d\u5217\u306b\u3057\u3066\u3001\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u306e\u96c6\u307e\u308a\u3092\u8868\u3059\u306e\u306b\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u3084\u6587\u5b57\u5217\u3082\u3001\u88cf\u3067\u306f<span>byte<\/span>\u306e\u96c6\u307e\u308a\u3067\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u6271\u3048\u308b\u3082\u306e\u306f\u5168\u3066<span>byte<\/span>\u3067\u8868\u305b\u308b\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte[] java1 = { 0x4a, 0x61, 0x76, 0x61 }; \/\/ \"Java\"\u306e\u30d0\u30a4\u30ca\u30ea\u8868\u73fe(UTF-16)\r\nString java2 = new String(java1); \/\/ String\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf(String(byte[]))\r\nSystem.out.println(java2); \/\/ \u2192 \"Java\"\r\n\r\nbyte[] java3 = \"Java\".getBytes();\r\nSystem.out.println(java.util.Arrays.toString(java3)); \/\/ \u2192 [74, 97, 118, 97]\r\n\r\nbyte[] file = Files.readAllBytes(Paths.get(\"\/A\/B\/C.dat\")); \/\/ \u30d5\u30a1\u30a4\u30ebC.dat\u306e\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf<\/pre>\n<p>byte\u914d\u5217\u3092\u4f7f\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u66f8\u304d\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u307f\u7d42\u308f\u3063\u305f\u5f8c\u306b\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3082\u8aad\u3093\u3067\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n<span style=\"text-decoration:none !important; background-color:#a61e58; color:white; padding:4px 13px; font-size:12px; font-weight:bold; position:relative; top:10px; z-index:1; left:11px;\">\u95a2\u9023\u8a18\u4e8b<\/span>\n<div class=\"blog-card\"><a target=\"_blank\" href=\"https:\/\/www.bold.ne.jp\/engineer-club\/java-file\" style=\"text-decoration:none;\">\n    <div class=\"blog-card-thumbnail\"><img src='https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2018\/10\/shutterstock_568617811-600x366.jpg' alt='java file\u3068\u306f\uff1fFile\u3068NIO.2\u3092\u4f7f\u3063\u305fJava\u3067\u306e\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c' width=160 height=98 \/><\/div>\n    <div class=\"blog-card-content\">\n        <div class=\"blog-card-title\">java file\u3068\u306f\uff1fFile\u3068NIO.2\u3092\u4f7f\u3063\u305fJava\u3067\u306e\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c <\/div>\n        <span style=\"font-size: 12px; font-weight: normal; position:relative; color:#666;\"><i class=\"fa fa-clock-o\"><\/i>&nbsp;2025\/09\/17<\/span>\n    <\/div>\n<div class=\"clear\"><\/div>\n<\/a><\/div>\n\n<span style=\"text-decoration:none !important; background-color:#a61e58; color:white; padding:4px 13px; font-size:12px; font-weight:bold; position:relative; top:10px; z-index:1; left:11px;\">\u95a2\u9023\u8a18\u4e8b<\/span>\n<div class=\"blog-card\"><a target=\"_blank\" href=\"https:\/\/www.bold.ne.jp\/engineer-club\/java-reading-files\" style=\"text-decoration:none;\">\n    <div class=\"blog-card-thumbnail\"><img src='https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2018\/10\/shutterstock_568617811-600x366.jpg' alt='Java\u3067\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u3059\u308b\u8d85\u5b9f\u8df5\u7684\u306a3\u3064\u306e\u65b9\u6cd5\u3010\u521d\u5fc3\u8005\u3067\u3082\u3067\u304d\u308b\u3011' width=160 height=98 \/><\/div>\n    <div class=\"blog-card-content\">\n        <div class=\"blog-card-title\">Java\u3067\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u3059\u308b\u8d85\u5b9f\u8df5\u7684\u306a3\u3064\u306e\u65b9\u6cd5\u3010\u521d\u5fc3\u8005\u3067\u3082\u3067\u304d\u308b\u3011 <\/div>\n        <span style=\"font-size: 12px; font-weight: normal; position:relative; color:#666;\"><i class=\"fa fa-clock-o\"><\/i>&nbsp;2025\/10\/06<\/span>\n    <\/div>\n<div class=\"clear\"><\/div>\n<\/a><\/div>\n<h2><span id=\"byte\">\uff12\uff0ebyte\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/span><\/h2>\n<p>\u3053\u306e\u7ae0\u3067\u306f\u3001<span>byte<\/span>\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u3001\u30b5\u30f3\u30d7\u30eb\u3092\u4ea4\u3048\u306a\u304c\u3089\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"-byte-2\">\uff12-\uff11\uff0ebyte\u306e\u5ba3\u8a00\u306e\u4ed5\u65b9\u3001\u521d\u671f\u5024\u3001\u30ea\u30c6\u30e9\u30eb<\/span><\/h3>\n<h4>\uff12-\uff11-\uff11\uff0ebyte\u306e\u5909\u6570\u30fb\u914d\u5217\u306e\u5ba3\u8a00\u3001\u521d\u671f\u5024\u306e\u6307\u5b9a<\/h4>\n<p>byte\u306f\u578b\u306e\u4e00\u3064\u3067\u3059\u304b\u3089\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u6570\u3084\u914d\u5217\u5909\u6570\u306e\u578b\u3068\u3057\u3066\u4f7f\u3048\u307e\u3059\u3002\u3082\u3061\u308d\u3093\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u3084\u3001\u623b\u308a\u5024\u3068\u3057\u3066\u3082\u4f7f\u3048\u307e\u3059\u3002\u914d\u5217\u306e\u5ba3\u8a00\u3084\u5024\u306e\u4ee3\u5165\u3084\u521d\u671f\u5316\u3082\u3001\u4ed6\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u3068\u540c\u3058\u3088\u3046\u306b\u884c\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ byte\u578b\u306e\u5909\u6570\u306e\u5ba3\u8a00\u3068\u3001\u521d\u671f\u5024\u306e\u4ee3\u5165\r\nbyte b = 100;\r\n\r\n\/\/ byte\u578b\u306e\u914d\u5217\u306e\u5ba3\u8a00\u3068\u3001\u5404\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3078\u306e\u5024\u306e\u4ee3\u5165\r\nbyte[] byteArray1 = new byte[3];\r\nbyteArray1[0] = 11;\r\nbyteArray1[1] = 12;\r\nbyteArray1[2] = 13;\r\n\r\n\/\/ byte\u578b\u306e\u914d\u5217\u306e\u5ba3\u8a00\u3068\u3001\u521d\u671f\u5316\u3092\u540c\u6642\u306b\u884c\u3046\r\nbyte[] byteArray2 = { -128, 0, 127 };<\/pre>\n<h4>\uff12-\uff11-\uff12\uff0ebyte\u306e\u30ea\u30c6\u30e9\u30eb\u306e\u66f8\u304d\u65b9<\/h4>\n<p>byte\u3092\u30ea\u30c6\u30e9\u30eb\u3067\u8868\u73fe\u3059\u308b\u6642\u306f\u3001\u63a5\u982d\u8a9e\u3092\u3064\u3051\u306a\u3051\u308c\u3070<span>10<\/span>\u9032\u6570\u3067\u3059\u3002<span>Java 11<\/span>\u306e\u6642\u70b9\u3067\u306f<span>10<\/span>\u9032\u6570\u306e\u4ed6\u306b\u4ee5\u4e0b\u306e\u66f8\u304d\u65b9\u304c\u3067\u304d\u307e\u3059\u3002\u3055\u3089\u306b\u3001<span>&#8220;_&#8221;<\/span>\u3067\u6841\u533a\u5207\u308a\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u3082\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><span>2<\/span>\u9032\u6570<span>(&#8220;0b&#8221;<\/span>\u3067\u59cb\u307e\u308b\u3001<span>Java 7<\/span>\u304b\u3089<span>)<\/span><\/li>\n<li><span>8<\/span>\u9032\u6570<span>(&#8220;0&#8221;<\/span>\u3067\u59cb\u307e\u308b<span>)<\/span><\/li>\n<li><span>10<\/span>\u9032\u6570<span>(<\/span>\u63a5\u982d\u8a9e\u306a\u3057<span>)<\/span><\/li>\n<li><span>16<\/span>\u9032\u6570<span>(&#8220;0x&#8221;<\/span>\u3067\u59cb\u307e\u308b<span>)<\/span><\/li>\n<\/ul>\n<pre class=\"prettyprint lang:default decode:true\">byte b1 = 0;\r\nbyte b2 = 127;\r\nbyte b3 = -128;\r\n\r\nbyte b4 = 0b1111; \/\/ 2\u9032\u6570\u8868\u793a\u300110\u9032\u6570\u306715\r\nbyte b5 = 0b0111_1111; \/\/ 2\u9032\u6570\u8868\u793a\u300110\u9032\u6570\u3067127\r\nbyte b6 = 017; \/\/ 8\u9032\u6570\u8868\u793a\u300110\u9032\u6570\u306715\r\nbyte b7 = 0xf; \/\/ 16\u9032\u6570\u8868\u793a\u300110\u9032\u6570\u306715<\/pre>\n<p>\u306a\u304a\u3001<span>1<\/span>\u30d0\u30a4\u30c8\u306e\u7bc4\u56f2\u306f\u7b26\u53f7\u306a\u3057\u306e<span>0<\/span>\uff5e<span>255<\/span>\u3068\u899a\u3048\u3066\u3044\u308b\u306e\u304c\u666e\u901a\u3067\u3057\u3087\u3046\u3002\u3067\u3059\u304b\u3089\u3001<span>Java<\/span>\u306e<span>byte<\/span>\u306e\u5909\u6570\u3078\u3001\u4f8b\u3048\u3070<span>255<\/span>\u3001<span>0xff<\/span>\u3001<span>0b1111_1111<\/span>\u304c\u4ee3\u5165\u3067\u304d\u308b\u3068\u601d\u3044\u304c\u3061\u3067\u3059\u3002\u3067\u3082\u3001\u305d\u308c\u306f<span>Java<\/span>\u3067\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b1 = 255; \/\/ \u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc!! 255\u306f-128\uff5e127\u306e\u7bc4\u56f2\u5185\u306b\u7121\u3044\u305f\u3081\r\nbyte b2 = 0xff; \/\/ \u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc!! 0xff\u306f10\u9032\u6570\u3067255\u3001\u30a8\u30e9\u30fc\u306e\u7406\u7531\u306f\u2191\u3068\u540c\u3058\r\nbyte b3 = 0b1111_1111; \/\/ \u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc!! 0b1111_1111\u306f10\u9032\u6570\u3067255\u3001\u30a8\u30e9\u30fc\u306e\u7406\u7531\u306f\u2191\u3068\u540c\u3058<\/pre>\n<p>\u306a\u305c\u306a\u3089\u3001<span>255<\/span>\u3084<span>0xff<\/span>\u306f<span>Java<\/span>\u306e<span>byte<\/span>\u3067\u8868\u73fe\u3067\u304d\u308b<span>-128<\/span>\uff5e<span>127<\/span>\u306e\u7bc4\u56f2\u306b\u7121\u3044\u6570\u5024\u3060\u304b\u3089\u3067\u3059\u3002\u305f\u3060\u3001\u660e\u793a\u7684\u306a<span>byte<\/span>\u3078\u306e\u30ad\u30e3\u30b9\u30c8\u3092\u3059\u308c\u3070\u4ee3\u5165\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u4ed5\u7d44\u307f\u306b\u306f<span>int<\/span>\u3068<span>byte<\/span>\u306e\u5909\u63db\u306e\u4ed5\u69d8\u304c\u95a2\u4fc2\u3057\u307e\u3059\u304c\u3001\u8a73\u3057\u304f\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b1 = (byte) 255; \/\/ byte\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068\u3001byte\u3067\u306e-1(1111 1111)\u306b\u306a\u308b\r\nbyte b2 = (byte) 0xff; \/\/ \u540c\u4e0a\r\nbyte b3 = (byte) 0b1111_1111; \/\/ \u540c\u4e0a<\/pre>\n<p>\u305f\u3060\u3001<span>0<\/span>\uff5e<span>255<\/span>\u306e\u7bc4\u56f2\u3067\u6570\u5024\u3092\u6271\u3063\u3066\u3001\u305d\u308c\u3092<span>byte<\/span>\u3068\u306e\u9593\u3067\u81ea\u7531\u306b\u5909\u63db\u3067\u304d\u308c\u3070\u3001\u305d\u308c\u306f\u305d\u308c\u3067\u5206\u304b\u308a\u3084\u3059\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3057\u3001\u4fbf\u5229\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u306e\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3053\u3061\u3089\u3082\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<h4>\uff12-\uff11-\uff13\uff0ebyte\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3001\u914d\u5217\u306e\u521d\u671f\u5024\u306f<span>0<\/span><\/h4>\n<p>\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3057\u3066<span>byte<\/span>\u578b\u306e\u5909\u6570\u3092\u4f7f\u3063\u305f\u308a\u3001<span>byte<\/span>\u578b\u306e\u914d\u5217\u3092\u4f7f\u3046\u5834\u5408\u306f\u3001\u672a\u521d\u671f\u5316\u3060\u3068<span>0<\/span>\u306b\u306a\u308a\u307e\u3059\u3002\u4ed6\u306e\u6570\u5024\u578b\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u3068\u540c\u3058\u52d5\u304d\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">class ByteTest {\r\n\tbyte b; \/\/ byte\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3057\u3066\u5ba3\u8a00\u3057\u305f\u304c\u3001\u521d\u671f\u5024\u306f\u672a\u8a2d\u5b9a\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tByteTest byteTest = new ByteTest();\r\n\t\tSystem.out.println(byteTest.b); \/\/ \u2192 0\u3001\u5ba3\u8a00\u6642\u306b\u672a\u521d\u671f\u5316\u306a\u306e\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304c\u8a2d\u5b9a\u3055\u308c\u308b\r\n\r\n\t\tbyte[] array = new byte[3];\r\n\t\tSystem.out.println(array[0]); \/\/ \u2192 0\u3001new\u3057\u305f\u6642\u70b9\u3067\u914d\u5217\u5168\u4f53\u304c0\u3067\u521d\u671f\u5316\u3055\u308c\u308b\r\n\t}\r\n}<\/pre>\n<h3><span id=\"-byte-3\">\uff12-\uff12\uff0ebyte\u3092\u4f7f\u3063\u305f\u56db\u5247\u6f14\u7b97<\/span><\/h3>\n<p>byte\u3092\u4f7f\u3063\u305f\u56db\u5247\u6f14\u7b97<span>(<\/span>\u52a0\u6e1b\u4e57\u9664<span>)<\/span>\u306b\u306f\u3001\u56db\u5247\u6f14\u7b97\u7528\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3001\u3064\u307e\u308a<span>+-*\/<\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002\u4f59\u308a\u3092\u6c42\u3081\u308b\u306a\u3089<span>%<\/span>\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u8a08\u7b97\u7d50\u679c\u3067\u5c0f\u6570\u70b9\u304c\u51fa\u305f\u5834\u5408\u3001<span>byte<\/span>\u306e\u5909\u6570\u3078\u4ee3\u5165\u3059\u308b\u3068\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306e\u5024\u306f\u5207\u308a\u6368\u3066\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u6574\u6570\u578b\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u306b\u5171\u901a\u3059\u308b\u52d5\u304d\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte i = 10;\r\nbyte j = 3;\r\n\r\nbyte plus = (byte)(i + j);\r\nbyte minus = (byte)(i - j);\r\nbyte multiply = (byte)(i * j);\r\nbyte divide = (byte)(i \/ j);\r\nbyte surplus = (byte)(i % j);\r\n\r\nSystem.out.println(plus); \/\/ \u2192 13\r\nSystem.out.println(minus); \/\/ \u2192 7\r\nSystem.out.println(multiply); \/\/ \u2192 30\r\nSystem.out.println(divide); \/\/ \u2192 3(\u8a08\u7b97\u4e0a\u306f10 \/ 3 = 3.333\u2026\u3060\u304c\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u304c\u5207\u308a\u6368\u3066\u3089\u308c\u30660\u306b\u306a\u308b)\r\nSystem.out.println(surplus); \/\/ \u2192 1<\/pre>\n<p>\u306a\u304a\u3001<span>Java<\/span>\u3067\u306f<span>byte\/short<\/span>\u3078\u306e\u6f14\u7b97\u306f<span>int<\/span>\u306b\u81ea\u52d5\u7684\u306b\u5909\u63db\u3057\u3066\u884c\u3046\u306e\u304c\u4ed5\u69d8\u3067\u3001\u8a08\u7b97\u7d50\u679c\u3082<span>int<\/span>\u306b\u306a\u308a\u307e\u3059\u3002\u3067\u3059\u306e\u3067\u3001\u8a08\u7b97\u7d50\u679c\u3092<span>byte<\/span>\u306b\u3059\u308b\u306a\u3089\u3001\u4f8b\u306e\u3088\u3046\u306b<span>byte<\/span>\u3078\u306e\u660e\u793a\u7684\u306a\u30ad\u30e3\u30b9\u30c8\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<span>byte<\/span>\u4ee5\u5916\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u304b\u3089<span>byte<\/span>\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u969b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3069\u3046\u3044\u3046\u6271\u3044\u304c\u3055\u308c\u308b\u304b\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<h4>\uff12-\uff12-\uff11\uff0ebyte\u306e\u8a08\u7b97\u3067\u306f\u3001\u7b26\u53f7\u306e\u5909\u5316\u306b\u8981\u6ce8\u610f<span>!!<\/span><\/h4>\n<p>byte\u3092\u6271\u3046\u6642\u306f\u3001\u7b26\u53f7\u306e\u5909\u5316\u306b\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>byte\u306b\u6570\u5024\u3092\u52a0\u6e1b\u7b97\u3057\u3066\u3001\u30d7\u30e9\u30b9\u5074\u306e\u6700\u5927\u5024\u3092\u8d85\u3048\u308b\u3068\u30de\u30a4\u30ca\u30b9\u5074\u306e\u6700\u5927\u5024\u306b\u306a\u308a\u3001\u30de\u30a4\u30ca\u30b9\u5074\u306e\u6700\u5c0f\u5024\u3088\u308a\u3082\u5c0f\u3055\u304f\u306a\u308b\u3068\u30d7\u30e9\u30b9\u5074\u306e\u6700\u5927\u5024\u306b\u306a\u308a\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u52a0\u7b97\u3057\u3066\u3044\u304f\u3068\u30d7\u30e9\u30b9\u30de\u30a4\u30ca\u30b9\u304c\u3072\u3063\u304f\u308a\u8fd4\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u304c\u3042\u308a\u3001\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u3068\u547c\u3070\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b1 = Byte.MAX_VALUE;\r\nbyte b2 = (byte)(b1 + 1);\r\nbyte b3 = (byte)(b1 + 2);\r\nSystem.out.println(b1); \/\/ \u2192 127\r\nSystem.out.println(b2); \/\/ \u2192 -128\r\nSystem.out.println(b3); \/\/ \u2192 -127\r\n\r\nbyte b4 = Byte.MIN_VALUE;\r\nbyte b5 = (byte)(b4 - 1);\r\nbyte b6 = (byte)(b4 - 2);\r\nSystem.out.println(b4); \/\/ \u2192 -128\r\nSystem.out.println(b5); \/\/ \u2192 127\r\nSystem.out.println(b6); \/\/ \u2192 126<\/pre>\n<p>\u3053\u308c\u306f\u3001\u4e8c\u9032\u6570\u3067\u8a00\u3046\u3068<span> 0111 1111 <\/span>\u3068<span> 1000 0000 <\/span>\u306e\u9593\u3067\u30d7\u30e9\u30b9\u30de\u30a4\u30ca\u30b9\u304c\u5909\u308f\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u524d\u8005\u304c<span>Byte.MAX_VALUE<\/span>\u3001\u5f8c\u8005\u304c<span>Byte.MIN_VALUE<\/span>\u3067\u3059\u3002\u3053\u308c\u3092\u7d30\u304b\u304f\u8a00\u3048\u3070\u3001<span>Java<\/span>\u3067\u306f<span>2<\/span>\u306e\u88dc\u6570\u3067\u30de\u30a4\u30ca\u30b9\u306e\u6570\u5024\u3092\u8868\u73fe\u3057\u3066\u3044\u308b\u304b\u3089\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>byte\u306f\u8868\u73fe\u3067\u304d\u308b\u7bc4\u56f2\u304c<span>8<\/span>\u30d3\u30c3\u30c8\u3068\u5c0f\u3055\u3044\u306e\u3067\u3001\u7279\u306b\u52a0\u7b97\u3084\u4e57\u7b97\u3092\u3059\u308b\u3068\u3059\u3050\u306b\u7bc4\u56f2\u3092\u8d85\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3067\u3059\u304b\u3089\u3001\u8a08\u7b97\u7d50\u679c\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570\u306f\u3001<span>byte<\/span>\u3088\u308a\u3082\u30d3\u30c3\u30c8\u6570\u304c\u5927\u304d\u306a\u578b\u306e<span>short<\/span>\u3001<span>int<\/span>\u306a\u3069\u306b\u3057\u3066\u304a\u3044\u3066\u3082\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b1 = 100;\r\nbyte b2 = 125;\r\nbyte sum = (byte)(b1 + b2);\r\nSystem.out.println(sum); \/\/ \u2192 -31<\/pre>\n<h3><span id=\"-byte-4\">\uff12-\uff13\uff0ebyte\u3067\u306e\u30d3\u30c3\u30c8\u6f14\u7b97<\/span><\/h3>\n<p>byte\u306f\u30d3\u30c3\u30c8\u6f14\u7b97\u306b\u3082\u4f7f\u3048\u307e\u3059\u3002\u696d\u52d9\u5411\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u30d3\u30c3\u30c8\u6f14\u7b97\u306f\u3042\u307e\u308a\u4f7f\u3044\u307e\u305b\u3093\u304c\u3001\u79d1\u5b66\u6280\u8853\u8a08\u7b97\u306a\u3069\u51e6\u7406\u901f\u5ea6\u304c\u5fc5\u8981\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u3067\u8a08\u7b97\u3059\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u3001\u639b\u3051\u7b97\u3084\u5272\u308a\u7b97\u3092\u30b7\u30d5\u30c8\u3067\u4ee3\u7528\u3059\u308b\u306e\u304c\u4ee3\u8868\u7684\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<span>C<\/span>\u8a00\u8a9e\u306a\u3069\u306e\u540d\u6b8b\u304c\u3042\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3060\u3068\u3001\u51e6\u7406\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3067\u6307\u5b9a\u3057\u305f\u308a\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4ed5\u69d8\u3067\u7279\u5b9a\u306e\u30d3\u30c3\u30c8\u304c<span>1<\/span>\u304b\u8abf\u3079\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u306e\u3084\u308a\u65b9\u306f\u899a\u3048\u3066\u304a\u3044\u3066\u3082\u640d\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u4ee5\u4e0b\u3067\u306f\u3001<span>Java<\/span>\u3067<span>byte<\/span>\u304c\u5bfe\u8c61\u306e\u30d3\u30c3\u30c8\u6f14\u7b97\u306e\u4f8b\u3092\u7c21\u5358\u306b\u793a\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u305f\u3060\u3001<span>Java<\/span>\u306e\u30d3\u30c3\u30c8\u6f14\u7b97\u306f<span>short<\/span>\u3068<span>byte<\/span>\u3067\u306f<span>int<\/span>\u306b\u5909\u63db\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u7d50\u679c\u3082<span>int<\/span>\u306a\u306e\u3067\u3001\u7279\u306b\u53f3\u30b7\u30d5\u30c8\u3067\u8ad6\u7406\u30b7\u30d5\u30c8<span>(&gt;&gt;&gt;)<\/span>\u3092\u3059\u308b\u306a\u3089\u4e8b\u524d\u306b<span>0xff<\/span>\u3068<span>&amp;<\/span>\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\u306a\u3069\u3001\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">public class BitOperatorSample {\r\n\tpublic static void main(String[] args) {\r\n\t\tbyte b1 = 0b101;\r\n\t\tbyte b2 = 0b010;\r\n\r\n\t\t\/\/ \u8ad6\u7406\u548c(or) |\r\n\t\tbyte or = (byte) (b1 | b2);\r\n\t\tSystem.out.println(toBinaryString(or)); \/\/ \u2192 00000111\r\n\t\t\/\/ \u8ad6\u7406\u7a4d(and) &amp;\r\n\t\tbyte and = (byte) (b1 &amp; b2);\r\n\t\tSystem.out.println(toBinaryString(and)); \/\/ \u2192 00000000\r\n\r\n\t\tb1 = 0b1100;\r\n\t\tb2 = 0b1010;\r\n\r\n\t\t\/\/ \u6392\u4ed6\u7684\u8ad6\u7406\u548c(xor) ^\r\n\t\tbyte xor = (byte) (b1 ^ b2);\r\n\t\tSystem.out.println(toBinaryString(xor)); \/\/ \u2192 00000110\r\n\r\n\t\tb1 = 0b1010;\r\n\r\n\t\t\/\/ \u8ad6\u7406\u5426\u5b9a(not) ~\r\n\t\tbyte not = (byte) ~b1;\r\n\t\tSystem.out.println(toBinaryString(not)); \/\/ \u2192 11110101\r\n\r\n\t\tb1 = 0b111;\r\n\r\n\t\t\/\/ \u5de6\u30b7\u30d5\u30c8 &lt;&lt;\r\n\t\tbyte ls = (byte) (b1 &lt;&lt; 1);\r\n\t\tSystem.out.println(toBinaryString(ls)); \/\/ \u2192 00001110\r\n\r\n\t\tb1 = -2; \/\/ 1111 1110\r\n\r\n\t\t\/\/ \u53f3\u30b7\u30d5\u30c8(\u7b97\u8853\u30b7\u30d5\u30c8) &gt;&gt;\r\n\t\tbyte rs1 = (byte) (b1 &gt;&gt; 1);\r\n\t\tSystem.out.println(toBinaryString(rs1)); \/\/ \u2192 11111111\r\n\t\t\/\/ \u53f3\u30b7\u30d5\u30c8(\u7b26\u53f7\u306a\u3057\u3001\u8ad6\u7406\u30b7\u30d5\u30c8) &gt;&gt;&gt;\r\n\t\tbyte rs2 = (byte) ((b1 &amp; 0xff) &gt;&gt;&gt; 1); \/\/ 0xff\u3068&amp;\u3057\u3066\u3001int\u3067\u306e9\u30d3\u30c3\u30c8\u76ee\u30920\u306b\u3057\u3066\u304b\u3089\u30b7\u30d5\u30c8\r\n\t\tSystem.out.println(toBinaryString(rs2)); \/\/ \u2192 01111111\r\n\t}\r\n\r\n\tprivate static String toBinaryString(byte b) {\r\n\t\treturn String.format(\"%8s\", Integer.toBinaryString(b &amp; 0xff)).replace(\" \", \"0\");\r\n\t}\r\n}<\/pre>\n<h2><span id=\"byte-2\">\uff13\uff0ebyte\u3068\u4ed6\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u3068\u306e\u5909\u63db<\/span><\/h2>\n<p>Java\u3067\u306f\u6570\u5024\u578b\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u3068\u3057\u3066\u3001<span>byte<\/span>\u3068\u30d3\u30c3\u30c8\u6570\u304c\u9055\u3046\u6574\u6570<span>(short\/char\/int\/long)<\/span>\u3068\u3001\u5c0f\u6570\u70b9\u304c\u6271\u3048\u308b\u3082\u306e<span>(float\/double)<\/span>\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>byte\u3092\u30d3\u30c3\u30c8\u6570\u304c\u3088\u308a\u5927\u304d\u3044\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u3078\u5909\u63db\u3059\u308b\u969b\u306f\u6570\u5024\u304c\u7dad\u6301\u3055\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u9006\u306b\u3001\u30d3\u30c3\u30c8\u6570\u304c\u5927\u304d\u306a\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u304b\u3089<span>byte<\/span>\u3078\u5909\u63db\u3059\u308b\u969b\u306b\u306f\u3001\u77e5\u3063\u3066\u304a\u304f\u3079\u304d\u3053\u3068\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u7ae0\u3067\u306f\u305d\u308c\u3092\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u524d\u8005\u306f\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e\u30ef\u30a4\u30c9\u30cb\u30f3\u30b0\u5909\u63db<span>(Widening Primitive Conversion)<\/span>\u3001\u5f8c\u8005\u306f\u30ca\u30ed\u30fc\u30a4\u30f3\u30b0\u5909\u63db<span>(Narrowing Primitive Conversion)<\/span>\u3068\u3082\u547c\u3070\u308c\u307e\u3059\u3002<\/p>\n<h3><span id=\"-shortcharintlongbyte\">\uff13-\uff11\uff0eshort\/char\/int\/long\u2192byte\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/span><\/h3>\n<p>\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u30d3\u30c3\u30c8\u6570\u304c\u5927\u304d\u306a\u65b9\u306e\u6574\u6570\u304b\u3089\u3001\u5c0f\u3055\u3044\u6574\u6570<span>(<\/span>\u3053\u306e\u8a18\u4e8b\u3067\u306f<span>byte)<\/span>\u306e\u30d3\u30c3\u30c8\u6570\u5206\u306e\u30c7\u30fc\u30bf\u3060\u3051\u3092\u3001\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3092\u305d\u306e\u307e\u307e\u306b\u53d6\u308a\u51fa\u3059\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002\u8a00\u8449\u3060\u3068\u5206\u304b\u308a\u3065\u3089\u3044\u306e\u3067\u3001\u5177\u4f53\u7684\u306a\u4f8b\u3067\u8aac\u660e\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">short s0 = 254; \/\/ 0000 0000 1111 1110\r\nSystem.out.println(s0); \/\/ \u2192 254\r\nbyte b0 = (byte) s0;\r\nSystem.out.println(b0); \/\/ \u2192 -2\u30011111 1110\r\n\r\nshort s1 = 255; \/\/ 0000 0000 1111 1111\r\nSystem.out.println(s1); \/\/ \u2192 255\r\nbyte b1 = (byte) s1;\r\nSystem.out.println(b1); \/\/ \u2192 -1\u30011111 1111\r\n\r\nshort s2 = 256; \/\/ 0000 0001 0000 0000\r\nSystem.out.println(s2); \/\/ \u2192 256\r\nbyte b2 = (byte) s2;\r\nSystem.out.println(b2); \/\/ \u2192 0\u30010000 0000<\/pre>\n<p>16\u30d3\u30c3\u30c8\u3067\u3042\u308b<span>short<\/span>\u306e<span>254<\/span>\u306f\u3001\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3067\u306f<span> 0000 0000 1111 1110 <\/span>\u3067\u3059\u3002\u3053\u308c\u3092<span>8<\/span>\u30d3\u30c3\u30c8\u306e<span>byte<\/span>\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068\u3001\u5f8c\u308d\u306e<span>8<\/span>\u30d3\u30c3\u30c8\u5206\u3060\u3051\u304c\u53d6\u308a\u51fa\u3055\u308c\u307e\u3059\u3002\u3067\u3059\u306e\u3067\u3001<span>byte<\/span>\u306e\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u306f<span> 1111 1110 <\/span>\u3068\u306a\u3063\u3066\u3001\u3053\u308c\u3092\u5148\u8ff0\u3057\u305f\u8868\u3067\u898b\u3066\u307f\u308b\u3068<span>-2<\/span>\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u540c\u3058\u3088\u3046\u306b\u3001<span>short<\/span>\u3067<span>255<\/span>\u306e\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u306f<span> 0000 0000 1111 1111 <\/span>\u3067\u3001<span>byte<\/span>\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068<span> 1111 1111<\/span>\u3001\u3059\u306a\u308f\u3061<span>-1<\/span>\u3067\u3059\u3002\u3055\u3089\u306b<span>short<\/span>\u3067<span>256<\/span>\u306f<span> 0000 0001 0000 0000 <\/span>\u3067\u3001<span>byte<\/span>\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068<span> 0000 0000<\/span>\u3001\u3059\u306a\u308f\u3061<span>0<\/span>\u3067\u3059\u3002<\/p>\n<h3><span id=\"-byteshortcharintlong\">\uff13-\uff12\uff0ebyte\u2192short\/char\/int\/long\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/span><\/h3>\n<p>\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001\u30d3\u30c3\u30c8\u6570\u304c\u5927\u304d\u306a\u65b9\u306e\u6574\u6570\u306b\u3001\u5c0f\u3055\u3044\u6574\u6570<span>(<\/span>\u3053\u306e\u8a18\u4e8b\u3067\u306f<span>byte)<\/span>\u3067\u8868\u73fe\u3055\u308c\u3066\u3044\u308b\u6570\u5024\u304c\u305d\u306e\u307e\u307e\u5165\u308a\u307e\u3059\u3002\u3053\u3061\u3089\u3082\u5177\u4f53\u7684\u306a\u4f8b\u3067\u8aac\u660e\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b0 = -2;\r\nSystem.out.println(b0); \/\/ \u2192 -2\r\nshort s0 = (short) b0;\r\nSystem.out.println(s0); \/\/ \u2192 -2\r\n\r\nbyte b1 = -1;\r\nSystem.out.println(b1); \/\/ \u2192 -1\r\nshort s1 = (short) b1;\r\nSystem.out.println(s1); \/\/ \u2192 -1\r\n\r\nbyte b2 = 0;\r\nSystem.out.println(b2); \/\/ \u2192 0\r\nshort s2 = (short) b2;\r\nSystem.out.println(s2); \/\/ \u2192 0<\/pre>\n<p>8\u30d3\u30c3\u30c8\u3067\u3042\u308b<span>byte<\/span>\u306e<span>-2<\/span>\u306f\u3001\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3067\u306f<span> 1111 1110 <\/span>\u3067\u3059\u3002\u3053\u308c\u3092<span>16<\/span>\u30d3\u30c3\u30c8\u306e<span>short<\/span>\u306b\u30ad\u30e3\u30b9\u30c8\u3057\u3066\u3082\u3001<span>-2<\/span>\u3068\u3044\u3046\u6570\u5024\u306f\u305d\u306e\u307e\u307e\u3067\u3059\u3002<span>short<\/span>\u306e<span>-2<\/span>\u306e\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u306f<span> 1111 1111 1111 1110 <\/span>\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u540c\u3058\u6570\u5024\u306a\u306e\u3067\u3059\u304c\u3001\u578b\u304c\u9055\u3046\u306e\u3067\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3082\u9055\u3046\u306e\u3067\u3059\u3002<\/p>\n<p>\u540c\u3058\u3088\u3046\u306b\u3001<span>byte<\/span>\u306e<span>-1<\/span>\u306f<span> 1111 1111<\/span>\u3001<span>short<\/span>\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068\u6570\u5024\u306f<span>-1<\/span>\u306e\u307e\u307e\u3067<span> 1111 1111 1111 1110 <\/span>\u3067\u3059\u3002\u3055\u3089\u306b<span>byte<\/span>\u306e<span>0<\/span>\u306f<span> 0000 0000 <\/span>\u3067\u3001<span>short<\/span>\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068\u6570\u5024\u306f<span>0<\/span>\u3001\u3059\u306a\u308f\u3061<span> 0000 0000 0000 0000 <\/span>\u3067\u3059\u3002<\/p>\n<h3><span id=\"-floatdoublebyte\">\uff13-\uff13\uff0efloat\/double\u2192byte\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/span><\/h3>\n<p>\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001<span>float\/double<\/span>\u3067\u8868\u73fe\u3055\u308c\u3066\u3044\u308b\u6570\u5024\u304c\u4e00\u65e6<span>32<\/span>\u30d3\u30c3\u30c8\u6574\u6570\u306e<span>int<\/span>\u306b\u5909\u63db\u3055\u308c\u3001\u305d\u306e\u5f8c\u306b\u30d3\u30c3\u30c8\u306e\u5927\u304d\u3044\u6574\u6570<span>\u2192<\/span>\u5c0f\u3055\u3044\u6574\u6570\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u5909\u63db\u3055\u308c\u307e\u3059\u3002<span>float\/double<\/span>\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3068<span>byte\/int<\/span>\u306a\u3069\u306e\u6574\u6570\u578b\u3067\u306f\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u306b\u4e92\u63db\u6027\u304c\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u4e00\u65e6<span>int<\/span>\u3092\u7d4c\u7531\u3059\u308b\u306e\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">float f0 = 254.5f;\r\nSystem.out.println(f0); \/\/ \u2192 254.5\r\nbyte b0 = (byte) f0;\r\nSystem.out.println(b0); \/\/ \u2192 -2\r\n\r\nfloat f1 = 255.5f;\r\nSystem.out.println(f1); \/\/ \u2192 255.5\r\nbyte b1 = (byte) f1;\r\nSystem.out.println(b1); \/\/ \u2192 -1\r\n\r\nfloat f2 = 256.5f;\r\nSystem.out.println(f2); \/\/ \u2192 256.5\r\nbyte b2 = (byte) f2;\r\nSystem.out.println(b2); \/\/ \u2192 0<\/pre>\n<p>float\u304c<span>254.5<\/span>\u306e\u6642\u306e\u5834\u5408\u3060\u3051\u89e3\u8aac\u3057\u307e\u3059\u3002\u307e\u305a\u306f<span>254.5<\/span>\u304c<span>32<\/span>\u30d3\u30c3\u30c8\u306e<span>int<\/span>\u3078\u5909\u63db\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u969b\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306f\u5207\u308a\u6368\u3066\u3089\u308c\u3001<span>254<\/span>\u306b\u306a\u308a\u307e\u3059\u3002<span>32<\/span>\u30d3\u30c3\u30c8\u306e<span>int<\/span>\u3067<span>254<\/span>\u306e\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u306f <span>0000 0000 0000 0000 0000 0000 1111 1110 <\/span>\u3067\u3059\u3002\u3053\u306e\u5f8c\u308d<span>8<\/span>\u30d3\u30c3\u30c8\u5206\u304c<span>byte<\/span>\u306b\u306a\u308b\u306e\u3067<span> 1111 1110 <\/span>\u3068\u306a\u308a\u3001\u6570\u5024\u3068\u3057\u3066\u306f<span>-2<\/span>\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<span>float\/double<\/span>\u304b\u3089\u306e\u30ad\u30e3\u30b9\u30c8\u5148\u304c<span>long<\/span>\u306e\u5834\u5408\u3060\u3051\u3001\u9014\u4e2d\u306b\u51fa\u3066\u304f\u308b\u6574\u6570\u578b\u306f<span>long<\/span>\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u6574\u6570\u578b\u306e\u5834\u5408\u306f<span>int<\/span>\u3067\u3059\u3002\u3053\u306e\u5909\u63db\u306e\u8a73\u7d30\u306f\u3001\u6574\u6570<span>\u2192<\/span>\u6574\u6570\u306e\u5834\u5408\u3082\u542b\u3081\u3001<span>Java<\/span>\u8a00\u8a9e\u4ed5\u69d8\u306e\u300c<span>Narrowing Primitive Conversion<\/span>\u300d\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3><span id=\"-bytefloatdouble\">\uff13-\uff14\uff0ebyte\u2192float\/double\u3078\u306e\u30ad\u30e3\u30b9\u30c8<\/span><\/h3>\n<p>\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001<span>byte<\/span>\u3067\u8868\u73fe\u3055\u308c\u3066\u3044\u308b\u5024\u304c<span>float\/double<\/span>\u306b\u305d\u306e\u307e\u307e\u5165\u308a\u307e\u3059\u3002\u305d\u3082\u305d\u3082<span>float\/double<\/span>\u306f<span>byte<\/span>\u306e\u7bc4\u56f2\u306e\u6570\u5b57\u3092\u5168\u90e8\u8868\u73fe\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u6570\u5024\u305d\u306e\u3082\u306e\u3067\u3084\u308a\u3068\u308a\u3067\u304d\u308b\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b0 = -2;\r\nSystem.out.println(b0); \/\/ \u2192 -2\r\nfloat f0 = (float) b0;\r\nSystem.out.println(f0); \/\/ \u2192 -2.0\r\n\r\nbyte b1 = -1;\r\nSystem.out.println(b1); \/\/ \u2192 -1\r\nfloat f1 = (float) b1;\r\nSystem.out.println(f1); \/\/ \u2192 -1.0\r\n\r\nbyte b2 = 0;\r\nSystem.out.println(b2); \/\/ \u2192 0\r\nfloat f2 = (float) b2;\r\nSystem.out.println(f2); \/\/ \u2192 0.0<\/pre>\n<h3><span id=\"-byte0255IntegertoUnsignedInt\">\uff13-\uff15\uff0e\u3010\u5fdc\u7528\u3011<span>byte<\/span>\u3092<span>0<\/span>\uff5e<span>255<\/span>\u3067\u6271\u3044\u305f\u3044\u5834\u5408\u306f\u3001<span>Integer.toUnsignedInt<\/span>\u304b\u30d3\u30c3\u30c8\u6f14\u7b97\u3092\u4f7f\u304a\u3046<\/span><\/h3>\n<p>byte\u3067\u6271\u3048\u308b<span>-128<\/span>\uff5e<span>127<\/span>\u306e\u7bc4\u56f2\u306e\u6570\u5024\u3092\u3001<span>0<\/span>\uff5e<span>255<\/span>\u306e\u7bc4\u56f2\u3067\u6271\u3048\u308b\u3068\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u969b\u306b\u306f<span>byte<\/span>\u3092<span>int<\/span>\u306a\u3069\u306b\u5909\u63db\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u7ae0\u3067\u304a\u4f1d\u3048\u3057\u305f\u3068\u304a\u308a\u3001<span>byte<\/span>\u304b\u3089<span>int<\/span>\u3078\u306e\u5358\u7d14\u306a\u30ad\u30e3\u30b9\u30c8\u3067\u306f\u610f\u56f3\u3057\u305f\u3068\u304a\u308a\u306b\u5909\u63db\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001<span>Java 8<\/span>\u4ee5\u964d\u3067\u306f<span>Byte.toUnsignedInt<\/span>\u3092\u4f7f\u3046\u3068\u3001\u3044\u3044\u611f\u3058\u306b\u5909\u63db\u304c\u3067\u304d\u308b\u306e\u3067\u304a\u52e7\u3081\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b = -1; \/\/ byte\u306e-1\u306f\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3 1111 1111\u3001\u7b26\u53f7\u306a\u3057\u306a\u3089255\r\nint i1 = b; \/\/ \u3053\u3061\u3089\u3067\u306fint\u306b\u305d\u306e\u307e\u307e\u30ad\u30e3\u30b9\u30c8\r\nint i2 = Byte.toUnsignedInt(b); \/\/ \u3053\u3061\u3089\u3067\u306fByte.toUnsignedInt\u3067\u5909\u63db\r\nSystem.out.println(i1); \/\/ \u2192 -1\r\nSystem.out.println(i2); \/\/ \u2192 255!!<\/pre>\n<p>Java 7\u4ee5\u524d\u306e\u74b0\u5883\u306a\u3089\u3001<span>0xff<\/span>\u3068\u30d3\u30c3\u30c8\u6f14\u7b97\u306e<span>&amp;(<\/span>\u8ad6\u7406\u7a4d\u3001<span>AND)<\/span>\u3092\u3057\u305f\u7d50\u679c\u3067\u3044\u3044\u3067\u3057\u3087\u3046\u3002\u3053\u3046\u3059\u308b\u3068\u3001<span>byte<\/span>\u3067\u8868\u73fe\u3057\u3066\u3044\u308b\u6570\u5024\u3067\u306f\u306a\u304f\u3001<span>byte<\/span>\u306e<span>8<\/span>\u30d3\u30c3\u30c8\u5206\u306e\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3092\u305d\u306e\u307e\u307e<span>int<\/span>\u306b\u3057\u305f\u6570\u5024\u3092\u5f97\u3089\u308c\u307e\u3059\u3002\u30d3\u30c3\u30c8\u6f14\u7b97\u306f\u3001\u6570\u5024\u3067\u306f\u306a\u304f\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3067\u51e6\u7406\u3059\u308b\u304b\u3089\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b = -1; \/\/ byte\u306e-1\u306f\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3 1111 1111\u3001\u7b26\u53f7\u306a\u3057\u306a\u3089255\r\nint i = b &amp; 0xff; \/\/ \u3053\u3053\u3067byte\u30680xff\u3092and\u3059\u308b\u3068\u2026\r\nSystem.out.println(i); \/\/ \u2192 255!!<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001<span>Byte.toUnsignedInt<\/span>\u3067\u3084\u3063\u3066\u3044\u308b\u306e\u3082\u540c\u3058\u3053\u3068\u3067\u3059\u3002\u305f\u3060\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u3092\u4f7f\u3048\u3070\u3001\u5909\u63db\u5148\u306f<span>short<\/span>\u3067\u3082<span>OK<\/span>\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<span>0<\/span>\uff5e<span>255<\/span>\u307e\u3067\u306e\u7bc4\u56f2\u306e<span>int<\/span>\u3092\u3001<span>-128<\/span>\uff5e<span>127<\/span>\u306e<span>byte<\/span>\u306b\u518d\u5ea6\u5909\u63db\u3059\u308b\u306b\u306f\u3001\u5358\u306b<span>byte<\/span>\u3078\u30ad\u30e3\u30b9\u30c8\u3059\u308c\u3070<span>OK<\/span>\u3067\u3059\u3002\u3053\u306e\u4ed5\u7d44\u307f\u3082\u3053\u306e\u7ae0\u3067\u304a\u4f1d\u3048\u3057\u307e\u3057\u305f\u3088\u306d\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">int i = 255; \/\/ int\u306e255\u306f0000 ... 1111 1111\u3001\u5f8c\u308d\u306e8\u30d3\u30c3\u30c8\u3092\u305d\u306e\u307e\u307ebyte\u306e-1\u306b\u3057\u305f\u3044\u2026\r\nbyte b = (byte)i; \/\/ \u305d\u3093\u306a\u5834\u5408\u306fint\u3092byte\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308c\u3070\u3001\r\nSystem.out.println(b); \/\/ \u2192 -1!!<\/pre>\n<h2><span id=\"byteString\">\uff14\uff0ebyte\u3068<span>String<\/span>\u3068\u306e\u5909\u63db<\/span><\/h2>\n<p>String\u3082<span>Java<\/span>\u3067\u306f\u91cd\u8981\u306a\u30af\u30e9\u30b9\u3067\u3059\u3002<span>String<\/span>\u3092<span>byte<\/span>\u306b\u3059\u308b\u3053\u3068\u3001\u307e\u305f<span>byte<\/span>\u3092<span>String<\/span>\u306b\u3067\u304d\u308c\u3070\u3044\u308d\u3044\u308d\u3068\u4fbf\u5229\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u305d\u306e\u65b9\u6cd5\u3092\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"-Stringbyte\">\uff14-\uff11\uff0eString\u2192byte\u306e\u5909\u63db<\/span><\/h3>\n<p>\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u3093\u3060\u6587\u5b57\u5217\u3084\u3001\u5f15\u6570\u3067\u53d7\u3051\u53d6\u3063\u305f\u6587\u5b57\u5217\u304b\u3089<span>byte<\/span>\u3092\u4f5c\u308a\u305f\u3044\u6642\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3046\u3044\u3046\u6642\u306f<span>Byte.parseByte<\/span>\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002\u6587\u5b57\u5217\u3092<span>byte<\/span>\u306b\u5909\u63db\u3057\u3066\u304f\u308c\u307e\u3059\u3002<span>byte<\/span>\u306b\u89e3\u91c8\u3067\u304d\u306a\u3044\u6587\u5b57\u5217\u3078\u306f<span>NumberFormatException<\/span>\u304c<span>throw<\/span>\u3055\u308c\u307e\u3059\u306e\u3067\u3054\u6ce8\u610f\u3092\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">String byteStr = \"123\";\r\nbyte b = Byte.parseByte(byteStr);\r\nSystem.out.println(b); \/\/ \u2192 123<\/pre>\n<p>\u57fa\u6570<span>(<\/span>\u4f55\u9032\u6570\u304b\u3092\u8868\u3059\u6570\u5024<span>)<\/span>\u3092\u6307\u5b9a\u3059\u308b\u306a\u3089<span>Byte.parseByte(String, int)<\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002\u4e8c\u756a\u76ee\u306e\u5f15\u6570\u306b\u306f\u57fa\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001<span>2<\/span>\u9032\u6570\u306a\u3089<span>2<\/span>\u3067\u3059\u3057\u3001<span>16<\/span>\u9032\u6570\u306a\u3089<span>16<\/span>\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">String byteStr = \"10\";\r\nbyte b1 = Byte.parseByte(byteStr, 2); \/\/ 2\u9032\u6570\u3068\u3057\u3066\u89e3\u91c8\r\nbyte b2 = Byte.parseByte(byteStr, 10); \/\/ 10\u9032\u6570\u3068\u3057\u3066\u89e3\u91c8\r\nbyte b3 = Byte.parseByte(byteStr, 16); \/\/ 16\u9032\u6570\u3068\u3057\u3066\u89e3\u91c8\r\nSystem.out.println(b1); \/\/ \u2192 \"10\"\u306f2\u9032\u6570\u3067\u306f2\r\nSystem.out.println(b2); \/\/ \u2192 \"10\"\u306f10\u9032\u6570\u3067\u306f10\r\nSystem.out.println(b3); \/\/ \u2192 \"10\"\u306f16\u9032\u6570\u3067\u306f16<\/pre>\n<h3><span id=\"-byteString\">\uff14-\uff12\uff0ebyte\u2192String\u306e\u5909\u63db<\/span><\/h3>\n<p>\u9006\u306b\u3001<span>byte<\/span>\u3092<span>String<\/span>\u306b\u3057\u305f\u3044\u6642\u304c\u3042\u308a\u307e\u3059\u3002\u7c21\u5358\u306b\u3084\u308b\u306a\u3089\u3001<span>Byte.toString(byte)<\/span>\u304b\u3001<span>String.valueOf(byte)<\/span>\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<span>byte<\/span>\u304c\u6301\u3064\u6570\u5024\u304c<span>10<\/span>\u9032\u6570\u306e<span>String<\/span>\u306b\u306a\u308a\u307e\u3059\u3002\u3061\u306a\u307f\u306b\u3001\u3069\u3061\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3082\u7d50\u679c\u306f\u540c\u3058\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b = 123;\r\nString byteStr = String.valueOf(b);\r\nSystem.out.println(byteStr); \/\/ \u2192 \"123\"<\/pre>\n<p>\u307e\u305f\u3001<span>byte<\/span>\u306f<span>2<\/span>\u9032\u6570\u3084<span>16<\/span>\u9032\u6570\u8868\u8a18\u306b\u3057\u305f\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<span>16<\/span>\u9032\u6570\u306b\u3059\u308b\u306a\u3089<span>String.format<\/span>\u304c\u304a\u624b\u8efd\u3067\u3059\u304c\u3001<span>2<\/span>\u9032\u6570\u306b\u3059\u308b\u306b\u306f\u3082\u3046\u5c11\u3057\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067<span>0xff<\/span>\u3068<span>&amp;<\/span>\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u306f\u3001<span>Byte.toUnsignedInt<\/span>\u3067\u3082\u540c\u3058\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b = 123;\r\n\r\nString byteStr1 = String.format(\"%02x\", b);\r\nString byteStr2 = String.format(\"%8s\", Integer.toBinaryString(b &amp; 0xff)).replace(\" \", \"0\");\r\n\r\nSystem.out.println(byteStr1); \/\/ \u2192 7b\r\nSystem.out.println(byteStr2); \/\/ \u2192 01111011<\/pre>\n<h3><span id=\"-byteString-2\">\uff14-\uff13\uff0ebyte\u914d\u5217<span>\u2192String<\/span>\u306e\u5909\u63db<\/span><\/h3>\n<p>\u5b9f\u52d9\u3067\u3088\u304f\u3084\u308b\u306e\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u7528\u306b<span>byte<\/span>\u306e\u914d\u5217\u3092<span>String<\/span>\u306b\u3057\u3066\u30ed\u30b0\u306b\u51fa\u529b\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<h4>\uff14-\uff13-\uff11\uff0ejava.util.Arrays\u3092\u4f7f\u3046<\/h4>\n<p>byte\u914d\u5217\u306e<span>String<\/span>\u5909\u63db\u3092\u7c21\u5358\u306b\u884c\u3046\u306a\u3089\u3001<span>java.util.Arrays.toString(byte[])<\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002<span>byte<\/span>\u306e\u591a\u6b21\u5143\u914d\u5217\u306a\u3089\u3001<span>java.util.Arrays.deepToString(byte[])<\/span>\u3067\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte[] b1 = {74, 97, 118, 97}; \/\/ \"Java\"\r\nString str1 = java.util.Arrays.toString(b1);\r\nSystem.out.println(str1); \/\/ \u2192 [74, 97, 118, 97]\r\n\r\nbyte[][] b2 = {{74, 97, 118, 97}, {69, 78, 71, 73, 78, 69, 69, 82, 46, 67, 76, 85, 66}}; \/\/ \"Java\"\u3001\"ENGINEER.CLUB\"\r\nString str2 = java.util.Arrays.deepToString(b2);\r\nSystem.out.println(str2); \/\/ \u2192 [[74, 97, 118, 97], [69, 78, 71, 73, 78, 69, 69, 82, 46, 67, 76, 85, 66]]<\/pre>\n<h4>\uff14-\uff13-\uff12\uff0e\u81ea\u5206\u3067\u5909\u63db\u7528\u306e\u30af\u30e9\u30b9\u30fb\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u308b<\/h4>\n<p>\u305f\u3060\u3001<span>Arrays.toString<\/span>\u3084<span>deepToString<\/span>\u306f<span>10<\/span>\u9032\u6570\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002<span>2<\/span>\u9032\u6570\u3084<span>16<\/span>\u9032\u6570\u306e\u5834\u5408\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u5834\u5408\u3082\u591a\u3044\u3067\u3057\u3087\u3046\u3002\u305d\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u69d8\u306a\u30af\u30e9\u30b9\u30fb\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u308a\u307e\u3059\u3002\u66f8\u5f0f\u306f\u304a\u597d\u307f\u3067\u5909\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">import java.util.ArrayList;\r\nimport java.util.List;\r\nimport java.util.function.Function;\r\n\r\nclass ByteArrayConverter {\r\n\tstatic String toString(byte[] bytes, Function&lt;Byte, String&gt; converter) {\r\n\t\tList&lt;String&gt; l = new ArrayList&lt;&gt;(bytes.length);\r\n\t\tfor (byte b : bytes) {\r\n\t\t\tl.add(converter.apply(b));\r\n\t\t}\r\n\t\treturn String.join(\" \", l);\r\n\t}\r\n\r\n\tstatic String toDecimalString(byte b) {\r\n\t\treturn String.format(\"%d\", b);\r\n\t}\r\n\r\n\tstatic String toHexString(byte b) {\r\n\t\treturn String.format(\"%02x\", b);\r\n\t}\r\n\r\n\tstatic String toBinaryString(byte b) {\r\n\t\treturn String.format(\"%8s\", Integer.toBinaryString(b &amp; 0xff)).replace(\" \", \"0\");\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tbyte[] bytes = {74, 97, 118, 97};\r\n\t\tString str1 = ByteArrayConverter.toString(bytes, ByteArrayConverter::toDecimalString);\r\n\t\tString str2 = ByteArrayConverter.toString(bytes, ByteArrayConverter::toHexString);\r\n\t\tString str3 = ByteArrayConverter.toString(bytes, ByteArrayConverter::toBinaryString);\r\n\r\n\t\tSystem.out.println(str1); \/\/ \u2192 74 97 118 97\r\n\t\tSystem.out.println(str2); \/\/ \u2192 4a 61 76 61\r\n\t\tSystem.out.println(str3); \/\/ \u2192 01001010 01100001 01110110 01100001\r\n\t}\r\n}<\/pre>\n<p>\u306a\u304a\u3001\u4eca\u3067\u306f<span>Apache Commons<\/span>\u306a\u3069\u306e\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3082\u5909\u63db\u7528\u306e\u30af\u30e9\u30b9\u304c\u3042\u308a\u307e\u3059\u3057\u3001<span>Java 10<\/span>\u307e\u3067\u306a\u3089<span>Java SE<\/span>\u306e\u74b0\u5883\u3067<span>DatatypeConverter<\/span>\u3068\u3044\u3046\u30af\u30e9\u30b9\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p>\u3067\u3059\u304c\u3001\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u81ea\u7531\u306b\u4f7f\u3048\u306a\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3057\u3001<span>DatatypeConverter<\/span>\u306f<span>Java 11<\/span>\u4ee5\u964d\u306e<span>SE<\/span>\u74b0\u5883\u3067\u306f\u6a19\u6e96\u3067\u4f7f\u3048\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002\u3067\u3059\u306e\u3067\u3001\u3069\u306e\u3088\u3046\u306b\u5909\u63db\u3059\u308b\u306e\u304b\u3092\u77e5\u3063\u3066\u304a\u304f\u306e\u306f\u60aa\u3044\u3053\u3068\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2><span id=\"byteByte\">\uff15\uff0ebyte\u3068<span>Byte<\/span><\/span><\/h2>\n<p>Java\u3067\u306f<span>8<\/span>\u30d3\u30c3\u30c8\u306e\u6574\u6570\u3092\u8868\u73fe\u3059\u308b\u305f\u3081\u306b\u3001<span>byte<\/span>\u3068<span>Byte<\/span>\u306e\u4e8c\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<span>Java<\/span>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u521d\u5fc3\u8005\u306f\u3001\u306a\u305c\u540c\u3058\u6574\u6570\u306e\u8868\u3057\u65b9\u304c\u4e8c\u3064\u3042\u308b\u306e\u304b\u6df7\u4e71\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u7ae0\u3067\u306f\u305d\u306e\u7406\u7531\u3068\u3001<span>byte<\/span>\u3068<span>Byte<\/span>\u306e\u4f7f\u3044\u5206\u3051\u306e\u65b9\u91dd\u306a\u3069\u3092\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"i\">\uff15-\uff11\uff0e\u4e8c\u7a2e\u985e\u306e\u8868\u73fe\u65b9\u6cd5\u306f\u6027\u80fd\u78ba\u4fdd\u306e\u305f\u3081<\/span><\/h3>\n<p>Java\u3067\u306f\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e<span>byte<\/span>\u3068\u3001\u30af\u30e9\u30b9\u306e<span>Byte<\/span>\u306f\u5225\u7269\u3067\u3059\u3002<span>C#<\/span>\u306a\u3069\u3067\u306f\u3053\u3046\u3044\u3046\u533a\u5225\u304c\u306a\u3044\u306e\u306b\u3001\u306a\u305c<span>Java<\/span>\u3067\u306f\u3042\u308b\u306e\u304b\u3002\u3053\u308c\u306f\u3001<span>Java<\/span>\u304c\u751f\u307e\u308c\u305f\u5f53\u6642\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c\u901f\u5ea6\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u3067\u3057\u305f\u3002<\/p>\n<p>Java\u306f<span>1995<\/span>\u5e74\u306b\u767b\u5834\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u3002\u5f53\u6642\u306e<span>CPU<\/span>\u306e\u30af\u30ed\u30c3\u30af\u5468\u6ce2\u6570\u306f\u4eca\u3068\u306f\u6841\u304c\u9055\u3044\u3001\u4e00\u822c\u5411\u3051\u306e<span>CPU<\/span>\u3067\u3088\u3046\u3084\u304f<span>100MHz<\/span>\u3092\u8d85\u3048\u305f\u304f\u3089\u3044\u3002\u30e1\u30e2\u30ea\u306e\u91cf\u3082\u5168\u4f53\u3067\u6570<span>MB<\/span>\uff5e\u6570<span>10MB<\/span>\u3068\u975e\u5e38\u306b\u4e4f\u3057\u304b\u3063\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>byte\u306f<span>8<\/span>\u30d3\u30c3\u30c8\u306e\u6570\u5b57\u305d\u306e\u3082\u306e\u306a\u306e\u3067\u3001\u697d\u306b\u901f\u304f\u6271\u3048\u307e\u3059\u3002\u3057\u304b\u3057\u3001<span>byte<\/span>\u3092\u30af\u30e9\u30b9\u3068\u3059\u308b\u3068\u3001\u4e00\u3064\u306e<span>byte<\/span>\u306e\u6570\u5024\u3092\u8868\u3059\u306e\u306b<span>8<\/span>\u30d3\u30c3\u30c8\u3088\u308a\u3082\u305a\u3063\u3068\u591a\u304f\u306e\u30e1\u30e2\u30ea\u3092\u4f7f\u3044\u307e\u3059\u3002\u7c21\u5358\u306a\u8a08\u7b97\u3092\u3059\u308b\u306b\u3082\u3001\u51e6\u7406\u4e0a\u3067\u306f\u4f59\u5206\u306a\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"-Bytenull\">\uff15-\uff12\uff0e\u30af\u30e9\u30b9\u306e<span>Byte<\/span>\u306a\u3089<span>null<\/span>\u3092\u8868\u73fe\u3067\u304d\u308b<\/span><\/h3>\n<p>Java\u3067<span>Byte<\/span>\u3092\u4f7f\u3046\u306e\u306f\u3001<span>Byte<\/span>\u304c\u6301\u3064\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u305f\u3044\u6642\u3068\u3001\u5024\u304c\u306a\u3044\u5834\u5408<span>\u2026<\/span>\u3059\u306a\u308f\u3061<span>null<\/span>\u3092\u8868\u73fe\u3057\u305f\u3044\u6642\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001<span>SQL<\/span>\u3067\u306f\u5024\u306e\u6709\u308a\u7121\u3057\u3092<span>NULL<\/span>\u304b\u3069\u3046\u304b\u3067\u8868\u73fe\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u308c\u3092<span>Java<\/span>\u306e<span>byte<\/span>\u3067\u306f\u4e0a\u624b\u306b\u8868\u73fe\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u3067\u3059\u304b\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u306f<span>0<\/span>\u3084<span>-1<\/span>\u306a\u3069\u306e\u5024\u306b\u7279\u5225\u306a\u610f\u5473\u3092\u6301\u305f\u305b\u305f\u308a\u3001<span>Byte.MAX_VALUE<\/span>\u3084<span>MIN_VALUE<\/span>\u3092\u4f7f\u3046\u306e\u3067\u3059\u304c\u3001\u78ba\u5b9f\u3055\u306b\u306f\u6b20\u3051\u307e\u3059\u3002\u305d\u3046\u3044\u3046\u5024\u306e\u30c1\u30a7\u30c3\u30af\u3092\u5fd8\u308c\u308b\u306a\u3069\u306e\u30df\u30b9\u3082\u3057\u304c\u3061\u3067\u3059\u3002<\/p>\n<p>\u305d\u3046\u3044\u3046\u6642\u306b\u53c2\u7167\u578b\u3067\u3042\u308b<span>Byte<\/span>\u3092\u4f7f\u3048\u3070\u3001\u5024\u304c\u306a\u3044\u3053\u3068\u3092<span>null<\/span>\u3068\u3057\u3066\u8868\u73fe\u3067\u304d\u308b\u306e\u3067\u3059\u3002<span>Byte<\/span>\u3092\u3069\u3046\u3044\u3046\u6642\u306b\u4f7f\u3046\u304b\u5206\u304b\u3089\u306a\u3044\u65b9\u306f\u3001\u305d\u306e\u5909\u6570\u3067<span>null<\/span>\u3092\u8868\u73fe\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3092\u4e00\u3064\u306e\u6307\u91dd\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3><span id=\"-byteByte\">\uff15-\uff13\uff0e\u30aa\u30fc\u30c8\u30dc\u30af\u30b7\u30f3\u30b0\u3067<span>byte<\/span>\u3068<span>Byte<\/span>\u3092\u81ea\u52d5\u5909\u63db\u3059\u308b<\/span><\/h3>\n<p>Java 1.5\u3067\u30aa\u30fc\u30c8\u30dc\u30af\u30b7\u30f3\u30b0<span>(auto boxing)<\/span>\u3068\u3044\u3046\u4ed5\u7d44\u307f\u304c\u5c0e\u5165\u3055\u308c\u307e\u3057\u305f\u3002\u30aa\u30fc\u30c8\u30dc\u30af\u30b7\u30f3\u30b0\u3067\u3001<span>byte<\/span>\u3068<span>Byte<\/span>\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u307b\u307c\u540c\u3058\u3082\u306e\u3068\u3057\u3066\u6271\u3048\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067<span>byte<\/span>\u3092\u4f7f\u3046\u6240\u3067\u306f<span>Byte<\/span>\u3092\u4f7f\u3048\u307e\u3059\u3057\u3001<span>Byte<\/span>\u3092\u4f7f\u3046\u6240\u3067\u306f<span>byte<\/span>\u304c\u4f7f\u3048\u307e\u3059\u3002\u672c\u5f53\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u306f\u76f8\u5909\u308f\u3089\u305a<span>byte<\/span>\u3068<span>Byte<\/span>\u306f\u5225\u7269\u306a\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u9055\u3044\u3092<span>Java<\/span>\u304c\u88cf\u3067\u81ea\u52d5\u7684\u306b\u5909\u63db\u3092\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">Byte byteObj = Byte.valueOf(\"127\"); \/\/ Byte\r\nbyte bytePri = 127; \/\/ byte\r\n\r\nbytePri = byteObj; \/\/ \u2192 127\u3001byte\u306bByte\u3092\u4ee3\u5165\u3067\u304d\u308b\r\nbytePri = Byte.valueOf(\"127\"); \/\/ \u2192 127\u3001\u540c\u4e0a\r\nbyteObj = 127; \/\/ \u2192 127\u3001Byte\u306b\u30ea\u30c6\u30e9\u30eb\u3092\u4ee3\u5165\u3067\u304d\u308b<\/pre>\n<p>\u3053\u308c\u3067<span>Java<\/span>\u306e\u9762\u5012\u306a\u90e8\u5206\u304c\u3042\u308b\u7a0b\u5ea6\u89e3\u6d88\u3055\u308c\u307e\u3057\u305f\u3002\u3067\u3059\u304c\u3001\u524d\u8ff0\u306e\u3068\u304a\u308a<span>Byte<\/span>\u306f<span>null<\/span>\u3092\u8868\u305b\u307e\u3059\u304c\u3001<span>byte<\/span>\u306f\u5fc5\u305a\u4f55\u304b\u306e\u6574\u6570\u306a\u306e\u3067\u3001<span>null<\/span>\u306b\u76f8\u5f53\u3059\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3067\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4e88\u671f\u305b\u306c\u3068\u3053\u308d\u3067<span>NullPobyteerException<\/span>\u304c\u767a\u751f\u3057\u305f\u308a\u3057\u307e\u3059\u3002\u3053\u308c\u306f<span>2019<\/span>\u5e74\u306e<span>Java 11<\/span>\u306e\u6642\u70b9\u3067\u3082\u5909\u308f\u3063\u3066\u3044\u307e\u305b\u3093\u3002\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u6ce8\u610f\u3059\u308b\u304b\u3001<span>Optional<\/span>\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">class ByteTest {\r\n\tstatic Byte returnByte() {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tbyte b = returnByte(); \/\/ \u2192 null\u3092byte\u306b\u5909\u63db\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u5b9f\u884c\u3059\u308b\u3068NullPobyteerException\u304c\u767a\u751f\u3059\u308b!!\r\n\t}\r\n}<\/pre>\n<h3><span id=\"-byte-5\">\uff15-\uff14\uff0e\u3010\u5fdc\u7528\u3011\u7b26\u53f7\u306a\u3057<span>byte<\/span>\u3068\u3057\u3066\u306e\u6271\u3044\u65b9<\/span><\/h3>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u305a\u3063\u3068\u3001<span>byte<\/span>\u306f\u30d7\u30e9\u30b9\u30de\u30a4\u30ca\u30b9\u304c\u3042\u308b<span>8<\/span>\u30d3\u30c3\u30c8\u306e\u6574\u6570\u3060\u3068\u304a\u4f1d\u3048\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u305d\u308c\u306f\u4eca\u3082\u5909\u308f\u308a\u307e\u305b\u3093\u304c\u3001<span>Java 8<\/span>\u3067<span>byte<\/span>\u3092\u7b26\u53f7\u306a\u3057\u6574\u6570\u3068\u3057\u3066\u6271\u3048\u308b\u30e1\u30bd\u30c3\u30c9\u304c<span>Byte<\/span>\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u305d\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u3001<span>byte<\/span>\u306e<span>8<\/span>\u30d3\u30c3\u30c8\u3092\u30d5\u30eb\u306b\u4f7f\u3063\u305f\u8a08\u7b97\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3067\u3059\u3002\u6bd4\u8f03\u3057\u3066\u3044\u308b\u306e\u306f\u540c\u3058<span>byte<\/span>\u3067\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3082\u5909\u308f\u308a\u307e\u305b\u3093\u304c\u3001<span>compareUnsigned<\/span>\u3067\u306f<span>8<\/span>\u30d3\u30c3\u30c8\u76ee\u3082\u542b\u3081\u305f\u6574\u6570\u3068\u3057\u3066\u6bd4\u8f03\u3057\u3066\u3044\u308b\u306e\u304c\u5206\u304b\u308b\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">byte b1 = Byte.MAX_VALUE; \/\/ \u2192 0111 1111\r\nbyte b2 = Byte.MIN_VALUE; \/\/ \u2192 1000 0000\r\n\r\nint cmp1 = Byte.compare(b1, b2);\r\nint cmp2 = Byte.compareUnsigned(b1, b2);\r\n\r\nSystem.out.println(cmp1); \/\/ \u2192 255(b1\u306e\u65b9\u304c\u5927\u304d\u3044)\u3001b1\u306f\u30d7\u30e9\u30b9\u306a\u306e\u3067b2\u3088\u308a\u3082\u5927\u304d\u3044\r\nSystem.out.println(cmp2); \/\/ \u2192 -1(b2\u306e\u65b9\u304c\u5927\u304d\u3044)\u30018\u30d3\u30c3\u30c8\u3092\u30d5\u30eb\u306b\u4f7f\u3063\u3066\u3044\u308b\u305f\u3081\u3001b2\u306e\u65b9\u304c\u5927\u304d\u3044\u3068\u5224\u65ad\u3055\u308c\u308b<\/pre>\n<p>Byte.\uff5e<span>Unsigned<\/span>\u7cfb\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u4ee5\u4e0b\u306e\u3082\u306e\u3067\u3059\u3002\u305d\u308c\u305e\u308c\u306e\u8a73\u7d30\u306f\u3001<span>Javadoc<\/span>\u3092\u53c2\u7167\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<blockquote>\n<p>Byte.compareUnsigned\uff1a\u7b26\u53f7\u306a\u3057\u6574\u6570\u3068\u3057\u3066\u5927\u5c0f\u6bd4\u8f03\u3059\u308b<\/p>\n<p>Byte.toUnsignedInt\uff1a\u7b26\u53f7\u306a\u3057\u6574\u6570\u3068\u3057\u3066<span>int<\/span>\u306b\u5909\u63db\u3059\u308b<\/p>\n<p>Byte.toUnsignedLong\uff1a\u7b26\u53f7\u306a\u3057\u6574\u6570\u3068\u3057\u3066<span>long<\/span>\u306b\u5909\u63db\u3059\u308b<\/p>\n<\/blockquote>\n<h2><span id=\"i-2\">\uff16\uff0e\u307e\u3068\u3081<\/span><\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<span>Java<\/span>\u306e<span>byte<\/span>\u3092\u304a\u4f1d\u3048\u3057\u3066\u304d\u307e\u3057\u305f\u3002<span>Java<\/span>\u306e<span>byte<\/span>\u306f<span>1<\/span>\u30d0\u30a4\u30c8<span>(8<\/span>\u30d3\u30c3\u30c8<span>)<\/span>\u306e\u6574\u6570\u3067\u3001<span>-128<\/span>\uff5e<span>127<\/span>\u307e\u3067\u306e\u5024\u3092\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<span>byte<\/span>\u306f<span>Java<\/span>\u3067\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u3092\u30d0\u30a4\u30c8\u5358\u4f4d\u3067\u4f7f\u3046\u6642\u306e\u6a19\u6e96\u7684\u306a\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002<\/p>\n<p>Java\u3067\u306f\u3001<span>1<\/span>\u30d0\u30a4\u30c8\u5206\u306e\u6574\u6570\u3092\u8868\u73fe\u3059\u308b\u306b\u306f\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e<span>byte<\/span>\u3068\u3001\u30af\u30e9\u30b9<span>(<\/span>\u53c2\u7167\u578b<span>)<\/span>\u3068\u3057\u3066\u306e<span>Byte<\/span>\u306e\u4e8c\u7a2e\u985e\u304c\u3042\u308a\u3001\u305d\u308c\u3089\u306f\u9055\u3046\u3082\u306e\u3067\u3042\u308b\u3053\u3068\u306b\u306f\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002\u305f\u3060\u3001\u30aa\u30fc\u30c8\u30dc\u30af\u30b7\u30f3\u30b0\u306b\u3088\u308a\u9055\u3044\u304c\u898b\u3048\u306b\u304f\u304f\u306f\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001<span>byte<\/span>\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3084\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306e\u57fa\u672c\u3068\u306a\u308b\u30c7\u30fc\u30bf\u5358\u4f4d\u3067\u3059\u3002\u3067\u3059\u306e\u3067\u3001<span>Java<\/span>\u3067<span>byte<\/span>\u306e\u4f7f\u3044\u65b9\u3092\u5b66\u3093\u3067\u304a\u3051\u3070\u3001\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3082\u305d\u3046\u5927\u304d\u306a\u9055\u3044\u306a\u304f\u4f7f\u3048\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u7279\u306b\u30d3\u30c3\u30c8\u30d1\u30bf\u30fc\u30f3\u3068\u6570\u5024\u306e\u5bfe\u5fdc\u3092\u899a\u3048\u3066\u304a\u3051\u3070\u3001\u3044\u3056\u3068\u3044\u3046\u6642\u306b\u5f79\u306b\u7acb\u3061\u307e\u3059\u3002\u30c8\u30e9\u30d6\u30eb\u5bfe\u5fdc\u306a\u3069\u3067\u8a73\u7d30\u306a\u30c7\u30fc\u30bf\u3092\u898b\u308b\u6642\u306f<span>16<\/span>\u9032\u6570\u306a\u3069\u306e\u5f62\u5f0f\u3067\u898b\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067\u3001\u305d\u3046\u3044\u3046\u77e5\u8b58\u304c\u3042\u308b\u306a\u3057\u3067\u306f\u4f5c\u696d\u52b9\u7387\u304c\u5927\u304d\u304f\u9055\u3044\u307e\u3059\u3088\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u306ebyte\u306f\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e\u4e00\u3064\u3067\u30018\u30d3\u30c3\u30c8\u306e\u7bc4\u56f2\u3067-128\uff5e127\u307e\u3067\u306e\u6574\u6570\u3092\u8868\u73fe\u3059\u308b\u3082\u306e\u3067\u3059\u3002 byte\u306f\u4e3b\u306b\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3084\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u3092\u6271\u3046\u6642\u306b\u4f7f\u3044\u307e\u3059\u3002\u4eba\u306b\u3088\u3063\u3066\u306fbyte\u306f\u4f7f\u3063\u305f\u3053\u3068\u304c\u306a\u3044\u304b\u3082\u3057\u308c [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":804,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1500"}],"collection":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/comments?post=1500"}],"version-history":[{"count":10,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1500\/revisions"}],"predecessor-version":[{"id":5790,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1500\/revisions\/5790"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media\/804"}],"wp:attachment":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media?parent=1500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/categories?post=1500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}