<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>web development helpdesk &#187; byte array</title>
	<atom:link href="http://helpdesk.objects.com.au/tag/byte-array/feed" rel="self" type="application/rss+xml" />
	<link>http://helpdesk.objects.com.au</link>
	<description>objects quality - the visible difference</description>
	<lastBuildDate>Sun, 17 Jul 2011 12:27:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>How to convert byte array to long</title>
		<link>http://helpdesk.objects.com.au/java/how-to-convert-byte-array-to-long?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-convert-byte-array-to-long</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-convert-byte-array-to-long#comments</comments>
		<pubDate>Tue, 17 Nov 2009 21:25:27 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[byte array]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[long]]></category>
		<category><![CDATA[representation]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=1291</guid>
		<description><![CDATA[The following code can be used to convert a byte array (containing the bytes of a long) into a long. public static long byteArrayToLong(byte[] bytes) { long l = 0; for (int i=0; i&#60;8; i++) { l &#60;&#60;= 8; l ^= (long) bytes[i] &#38; 0xff; } return l; } This is the reverse of &#8220;How [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-convert-byte-array-to-long/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to save your SecretKey?</title>
		<link>http://helpdesk.objects.com.au/java/how-to-save-your-secretkey?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-save-your-secretkey</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-save-your-secretkey#comments</comments>
		<pubDate>Fri, 17 Jul 2009 04:24:39 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[AES]]></category>
		<category><![CDATA[byte array]]></category>
		<category><![CDATA[encoded]]></category>
		<category><![CDATA[JCE]]></category>
		<category><![CDATA[KeyGenerator]]></category>
		<category><![CDATA[SecretKey]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=1305</guid>
		<description><![CDATA[Once you have generated a SecretKey you can use it&#8217;s getEncoded() method to generate a byte array that can be used to recreate the key. // Use the following to initially create a random key KeyGenerator keyGen = KeyGenerator.getInstance(&#34;AES&#34;); kgen.init(256); SecretKey key = keyGen.generateKey(); // Then use the following to get the byte[] encoded = [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-save-your-secretkey/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to convert a long to a byte array</title>
		<link>http://helpdesk.objects.com.au/java/how-to-convert-a-long-to-a-byte-array?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-convert-a-long-to-a-byte-array</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-convert-a-long-to-a-byte-array#comments</comments>
		<pubDate>Fri, 15 May 2009 23:03:23 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[byte array]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[long]]></category>
		<category><![CDATA[representation]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=1161</guid>
		<description><![CDATA[The following code can be used to extract the 8 bytes from a long value and return them as a byte array public static byte[] longToByteArray(long data) { return new byte[] { (byte)((data &#62;&#62; 56) &#38; 0xff), (byte)((data &#62;&#62; 48) &#38; 0xff), (byte)((data &#62;&#62; 40) &#38; 0xff), (byte)((data &#62;&#62; 32) &#38; 0xff), (byte)((data &#62;&#62; 24) [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-convert-a-long-to-a-byte-array/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to convert a hex string to a byte array?</title>
		<link>http://helpdesk.objects.com.au/java/how-to-convert-a-hex-string-to-a-byte-array?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-convert-a-hex-string-to-a-byte-array</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-convert-a-hex-string-to-a-byte-array#comments</comments>
		<pubDate>Wed, 15 Apr 2009 07:22:17 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[byte array]]></category>
		<category><![CDATA[hex]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=896</guid>
		<description><![CDATA[The BigDecimal class makes this really easy as it has a method toByteArray() that returns exactly what we need. Just need to create a BigDecimal and call the method. byte[] bytes = new BigInteger(hexString, 16).toByteArray(); Related posts: How can I convert a byte array to a hex string representation? You have a couple of choices, [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-convert-a-hex-string-to-a-byte-array/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How do I convert an ip address into an array of bytes?</title>
		<link>http://helpdesk.objects.com.au/java/how-do-i-convert-an-ip-address-into-an-array-of-bytes?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-do-i-convert-an-ip-address-into-an-array-of-bytes</link>
		<comments>http://helpdesk.objects.com.au/java/how-do-i-convert-an-ip-address-into-an-array-of-bytes#comments</comments>
		<pubDate>Wed, 01 Oct 2008 13:07:46 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[byte array]]></category>
		<category><![CDATA[InetAddress]]></category>
		<category><![CDATA[ip address]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=359</guid>
		<description><![CDATA[Use the getAddress() method in the InetAddress class. InetAddress address = InetAddress.getByName(&#34;192.168.1.1&#34;); byte[] bytes = address.getAddress(); for (byte b : bytes) { System.out.println(b &#38; 0xFF); } Related posts: How do I get the ip address of the machine a Java application is running on? Use the InetAddress class. InetAddress address = InetAddress.getLocalHost(); byte[] ip... Lookup [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-do-i-convert-an-ip-address-into-an-array-of-bytes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

