<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Why HexaDecimal String of any VIntWritable has 8f at the start.? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-HexaDecimal-String-of-any-VIntWritable-has-8f-at-the/m-p/29777#M6653</link>
    <description>The first byte value is used as the sign indicator, if the number requires more than one byte to encode with.&lt;BR /&gt;&lt;BR /&gt;In your specific example with 172 and -172,&lt;BR /&gt;1000|1111, or 8f, is used to indicate positive numbers&lt;BR /&gt;1000|0111, or 87, is used to indicate negative numbers&lt;BR /&gt;&lt;BR /&gt;It helps also if you look at the sources to answer such questions, i.e. at &lt;A href="https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L271-L298" target="_blank"&gt;https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L271-L298&lt;/A&gt; (serialise) and &lt;A href="https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L307-L320" target="_blank"&gt;https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L307-L320&lt;/A&gt; (deserialise). Also look at this: &lt;A href="https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L369-L371" target="_blank"&gt;https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L369-L371&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Does this help?</description>
    <pubDate>Sun, 19 Jul 2015 11:43:32 GMT</pubDate>
    <dc:creator>Harsh J</dc:creator>
    <dc:date>2015-07-19T11:43:32Z</dc:date>
    <item>
      <title>Why HexaDecimal String of any VIntWritable has 8f at the start.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-HexaDecimal-String-of-any-VIntWritable-has-8f-at-the/m-p/29774#M6652</link>
      <description>&lt;P&gt;I am checking some concepts in Definitive guide and could not figure out this small logic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you convert VIntWritable to Byte Array and convert that byte array to string, there is additional '8f' at the start of any avalue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for normal IntWritable the value of 172 in hexa decimal representation is - 000000ac&lt;/P&gt;&lt;P&gt;for VIntWritable, the HexaDecimal String for 172&amp;nbsp; is&amp;nbsp; &lt;STRONG&gt;8f&lt;/STRONG&gt;ac&lt;/P&gt;&lt;P&gt;for VIntWritable, the HexaDecimal String for -172 is&amp;nbsp; 87ab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am confused. could you please elaborate a bit.?&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jul 2015 10:38:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-HexaDecimal-String-of-any-VIntWritable-has-8f-at-the/m-p/29774#M6652</guid>
      <dc:creator>Srini_D</dc:creator>
      <dc:date>2015-07-19T10:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why HexaDecimal String of any VIntWritable has 8f at the start.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-HexaDecimal-String-of-any-VIntWritable-has-8f-at-the/m-p/29777#M6653</link>
      <description>The first byte value is used as the sign indicator, if the number requires more than one byte to encode with.&lt;BR /&gt;&lt;BR /&gt;In your specific example with 172 and -172,&lt;BR /&gt;1000|1111, or 8f, is used to indicate positive numbers&lt;BR /&gt;1000|0111, or 87, is used to indicate negative numbers&lt;BR /&gt;&lt;BR /&gt;It helps also if you look at the sources to answer such questions, i.e. at &lt;A href="https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L271-L298" target="_blank"&gt;https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L271-L298&lt;/A&gt; (serialise) and &lt;A href="https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L307-L320" target="_blank"&gt;https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L307-L320&lt;/A&gt; (deserialise). Also look at this: &lt;A href="https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L369-L371" target="_blank"&gt;https://github.com/cloudera/hadoop-common/blob/cdh5.4.0-release/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableUtils.java#L369-L371&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Does this help?</description>
      <pubDate>Sun, 19 Jul 2015 11:43:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-HexaDecimal-String-of-any-VIntWritable-has-8f-at-the/m-p/29777#M6653</guid>
      <dc:creator>Harsh J</dc:creator>
      <dc:date>2015-07-19T11:43:32Z</dc:date>
    </item>
  </channel>
</rss>

