{"id":8661,"date":"2022-08-08T22:26:37","date_gmt":"2022-08-08T21:26:37","guid":{"rendered":"https:\/\/system-administrators.info\/?p=8661"},"modified":"2022-08-08T22:28:49","modified_gmt":"2022-08-08T21:28:49","slug":"%d0%ba%d0%be%d0%bd%d0%b2%d0%b5%d1%80%d1%82%d0%b0%d1%86%d0%b8%d1%8f-byte-to-bit-string-java","status":"publish","type":"post","link":"https:\/\/system-administrators.info\/?p=8661","title":{"rendered":"\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f Byte to Bit String (Java)"},"content":{"rendered":"<p>\u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u0441\u0435\u0431\u044f. \u041f\u0430\u0440\u043e\u0447\u043a\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0431\u0438\u0442\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430: \u0431\u0430\u0439\u0442 5 \u0441\u0442\u0430\u043d\u0435\u0442 \u201c00000101\u201d, \u0431\u0430\u0439\u0442 8 &#8212; \u201c00001000\u201d.<\/p>\n<pre>\u00a0public String toBits(final byte val) {\r\n\u00a0final StringBuilder result = new StringBuilder();\u00a0\r\nfor (int i=0; i&lt;8; i++) {\u00a0\r\nresult.append((int)(val &gt;&gt; (8-(i+1)) &amp; 0x0001));\u00a0\r\n}<\/pre>\n<div>return result.toString();}<\/div>\n<div>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/div>\n<pre>\u00a0public String toBitString(final byte val) {\u00a0\r\nreturn String.format(\"%8s\", Integer.toBinaryString(val &amp; 0xFF)).replace(' ', '0');\u00a0\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u0441\u0435\u0431\u044f. \u041f\u0430\u0440\u043e\u0447\u043a\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0431\u0438\u0442\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430: \u0431\u0430\u0439\u0442 5 \u0441\u0442\u0430\u043d\u0435\u0442 \u201c00000101\u201d, \u0431\u0430\u0439\u0442 8 &#8212; \u201c00001000\u201d. \u00a0public String toBits(final byte val) { \u00a0final StringBuilder result = new StringBuilder();\u00a0 for (int i=0; i&lt;8; i++) {\u00a0 result.append((int)(val &gt;&gt; (8-(i+1)) &amp; 0x0001));\u00a0 } return result.toString();} \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442: \u00a0public String toBitString(final byte [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,12],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/system-administrators.info\/?p=8661\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f Byte to Bit String (Java) - \u0414\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\" \/>\n<meta property=\"og:description\" content=\"\u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u0441\u0435\u0431\u044f. \u041f\u0430\u0440\u043e\u0447\u043a\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0431\u0438\u0442\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430: \u0431\u0430\u0439\u0442 5 \u0441\u0442\u0430\u043d\u0435\u0442 \u201c00000101\u201d, \u0431\u0430\u0439\u0442 8 &#8212; \u201c00001000\u201d. \u00a0public String toBits(final byte val) { \u00a0final StringBuilder result = new StringBuilder();\u00a0 for (int i=0; i&lt;8; i++) {\u00a0 result.append((int)(val &gt;&gt; (8-(i+1)) &amp; 0x0001));\u00a0 } return result.toString();} \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442: \u00a0public String toBitString(final byte [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/system-administrators.info\/?p=8661\" \/>\n<meta property=\"og:site_name\" content=\"\u0414\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-08T21:26:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-08T21:28:49+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\">\n\t<meta name=\"twitter:data2\" content=\"0 \u043c\u0438\u043d\u0443\u0442\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/system-administrators.info\/#website\",\"url\":\"https:\/\/system-administrators.info\/\",\"name\":\"\\u0414\\u043b\\u044f \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u043d\\u043e\\u0433\\u043e \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0430\",\"description\":\"\\u041c\\u0430\\u0442\\u0435\\u0440\\u0438\\u0430\\u043b\\u044b \\u0434\\u043b\\u044f \\u0441\\u0438\\u0441\\u0430\\u0434\\u043c\\u0438\\u043d\\u0430\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/system-administrators.info\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/system-administrators.info\/?p=8661#webpage\",\"url\":\"https:\/\/system-administrators.info\/?p=8661\",\"name\":\"\\u041a\\u043e\\u043d\\u0432\\u0435\\u0440\\u0442\\u0430\\u0446\\u0438\\u044f Byte to Bit String (Java) - \\u0414\\u043b\\u044f \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u043d\\u043e\\u0433\\u043e \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0430\",\"isPartOf\":{\"@id\":\"https:\/\/system-administrators.info\/#website\"},\"datePublished\":\"2022-08-08T21:26:37+00:00\",\"dateModified\":\"2022-08-08T21:28:49+00:00\",\"author\":{\"@id\":\"https:\/\/system-administrators.info\/#\/schema\/person\/bae452d4027b66e977d3fa026a6e3e61\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/system-administrators.info\/?p=8661\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/system-administrators.info\/#\/schema\/person\/bae452d4027b66e977d3fa026a6e3e61\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/system-administrators.info\/#personlogo\",\"inLanguage\":\"ru-RU\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e41d445bf40842e97447b7da2c87f00a?s=96&d=mm&r=g\",\"caption\":\"admin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/system-administrators.info\/index.php?rest_route=\/wp\/v2\/posts\/8661"}],"collection":[{"href":"https:\/\/system-administrators.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/system-administrators.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/system-administrators.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/system-administrators.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8661"}],"version-history":[{"count":1,"href":"https:\/\/system-administrators.info\/index.php?rest_route=\/wp\/v2\/posts\/8661\/revisions"}],"predecessor-version":[{"id":8662,"href":"https:\/\/system-administrators.info\/index.php?rest_route=\/wp\/v2\/posts\/8661\/revisions\/8662"}],"wp:attachment":[{"href":"https:\/\/system-administrators.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/system-administrators.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/system-administrators.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}