{"id":3478,"date":"2016-03-18T00:40:32","date_gmt":"2016-03-18T00:40:32","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3478"},"modified":"2016-03-18T00:40:32","modified_gmt":"2016-03-18T00:40:32","slug":"scala-new-byte-array","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/scala-new-byte-array\/","title":{"rendered":"Scala: new byte array"},"content":{"rendered":"<p>To create a new byte arrays in scala, you have two options.<\/p>\n<p>To initialize it with data, you can do this:<\/p>\n<pre lang=\"scala\">\nval data = Array[Byte](10, -32, 17, 22)\n<\/pre>\n<p>If you want to initialize it to a specific length like a Java array, do this:<\/p>\n<pre lang=\"scala\">\nval length = 1000\nArray.fill[Byte](length)(0)\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To create a new byte arrays in scala, you have two options. To initialize it with data, you can do this: val data = Array[Byte](10, -32, 17, 22) If you want to initialize it to a specific length like a Java array, do this: val length = 1000 Array.fill[Byte](length)(0)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[480,485,486],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3478"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3478"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3478\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}