{"id":428,"date":"2009-10-18T16:24:38","date_gmt":"2009-10-18T23:24:38","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2316"},"modified":"2009-10-18T16:24:38","modified_gmt":"2009-10-18T23:24:38","slug":"bytearrayreadutfbytes","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=428","title":{"rendered":"ByteArray.readUTFBytes()"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar m:ByteArray = new ByteArray();\r\nvar bytes:Array = &#x5B;0x41, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, \r\n\t\t\t\t   0x53, 0x6E, 0x69, 0x70, 0x70, 0x65, 0x74]\r\nfor (var i:int = 0; i &lt; bytes.length; i++){\r\n\tm.writeByte(bytes&#x5B;i]);\r\n}\r\n\r\nm.position = 0;\r\n \r\ntrace(m.readUTFBytes(bytes.length));\r\n<\/pre>\n<p>I was messing around with a hex editor today and decided to start playing with ByteArray for the first time in awhile. Just wrote this as a little warm up&#8230; Try running it to see what it traces out&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>var m:ByteArray = new ByteArray(); var bytes:Array = &#x5B;0x41, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x53, 0x6E, 0x69, 0x70, 0x70, 0x65, 0x74] for (var i:int = 0; i &lt; bytes.length; i++){ m.writeByte(bytes&#x5B;i]); } m.position = 0; trace(m.readUTFBytes(bytes.length)); I was messing around with a hex editor today and decided to start playing with ByteArray for the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,14,138,4],"class_list":["post-428","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-actionscript","tag-as3","tag-bytearray","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=428"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/428\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}