<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FData_Type%2FOctal</id>
		<title>Java/Data Type/Octal - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FData_Type%2FOctal"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Data_Type/Octal&amp;action=history"/>
		<updated>2026-04-21T21:57:52Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Data_Type/Octal&amp;diff=6751&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Data_Type/Octal&amp;diff=6751&amp;oldid=prev"/>
				<updated>2010-06-01T06:17:43Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:17, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Data_Type/Octal&amp;diff=6750&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Data_Type/Octal&amp;diff=6750&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:44Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Convert Decimal to Octal ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 public class Main {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    int integer = 1024;&lt;br /&gt;
    String octal = Integer.toOctalString(integer);&lt;br /&gt;
    System.out.printf(&amp;quot;Octal value of %d is &amp;quot;%s&amp;quot;.\n&amp;quot;, integer, octal);&lt;br /&gt;
    System.out.printf(&amp;quot;Octal value of %1$d is &amp;quot;%1$o&amp;quot;.\n&amp;quot;, integer);&lt;br /&gt;
    int original = Integer.parseInt(octal, 8);&lt;br /&gt;
    System.out.printf(&amp;quot;Integer value of octal &amp;quot;%s&amp;quot; is %d.&amp;quot;, octal, original);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Decodes Hex data into octects ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
/*   Copyright 2004 The Apache Software Foundation&lt;br /&gt;
 *&lt;br /&gt;
 *   Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 *   you may not use this file except in compliance with the License.&lt;br /&gt;
 *   You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 *       http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 *   Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 *   distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
 *   See the License for the specific language governing permissions and&lt;br /&gt;
 *  limitations under the License.&lt;br /&gt;
 */&lt;br /&gt;
//xmlbeans&lt;br /&gt;
import java.io.UnsupportedEncodingException;&lt;br /&gt;
/**&lt;br /&gt;
 * format validation&lt;br /&gt;
 *&lt;br /&gt;
 * This class encodes/decodes hexadecimal data&lt;br /&gt;
 * @author Jeffrey Rodriguez&lt;br /&gt;
 * @version $Id: HexBin.java 125124 2005-01-14 00:23:54Z kkrouse $&lt;br /&gt;
 */&lt;br /&gt;
public class Main {&lt;br /&gt;
  static private final int  BASELENGTH   = 255;&lt;br /&gt;
  static private final int  LOOKUPLENGTH = 16;&lt;br /&gt;
  static private byte [] hexNumberTable    = new byte[BASELENGTH];&lt;br /&gt;
  static private byte [] lookUpHexAlphabet = new byte[LOOKUPLENGTH];&lt;br /&gt;
&lt;br /&gt;
  static {&lt;br /&gt;
      for (int i = 0; i&amp;lt;BASELENGTH; i++ ) {&lt;br /&gt;
          hexNumberTable[i] = -1;&lt;br /&gt;
      }&lt;br /&gt;
      for ( int i = &amp;quot;9&amp;quot;; i &amp;gt;= &amp;quot;0&amp;quot;; i--) {&lt;br /&gt;
          hexNumberTable[i] = (byte) (i-&amp;quot;0&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
      for ( int i = &amp;quot;F&amp;quot;; i&amp;gt;= &amp;quot;A&amp;quot;; i--) {&lt;br /&gt;
          hexNumberTable[i] = (byte) ( i-&amp;quot;A&amp;quot; + 10 );&lt;br /&gt;
      }&lt;br /&gt;
      for ( int i = &amp;quot;f&amp;quot;; i&amp;gt;= &amp;quot;a&amp;quot;; i--) {&lt;br /&gt;
         hexNumberTable[i] = (byte) ( i-&amp;quot;a&amp;quot; + 10 );&lt;br /&gt;
      }&lt;br /&gt;
      for(int i = 0; i&amp;lt;10; i++ )&lt;br /&gt;
          lookUpHexAlphabet[i] = (byte) (&amp;quot;0&amp;quot;+i );&lt;br /&gt;
      for(int i = 10; i&amp;lt;=15; i++ )&lt;br /&gt;
          lookUpHexAlphabet[i] = (byte) (&amp;quot;A&amp;quot;+i -10);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * Decodes Hex data into octects&lt;br /&gt;
   *&lt;br /&gt;
   * @param binaryData String containing Hex data&lt;br /&gt;
   * @return string containing decoded data.&lt;br /&gt;
   */&lt;br /&gt;
  public static String decode(String binaryData) {&lt;br /&gt;
      if (binaryData == null)&lt;br /&gt;
          return null;&lt;br /&gt;
      byte[] decoded = null;&lt;br /&gt;
      try {&lt;br /&gt;
        decoded = decode(binaryData.getBytes(&amp;quot;utf-8&amp;quot;));&lt;br /&gt;
      }&lt;br /&gt;
      catch(UnsupportedEncodingException e) {&lt;br /&gt;
      }&lt;br /&gt;
      return decoded == null ? null : new String(decoded);&lt;br /&gt;
  }&lt;br /&gt;
  static public byte[] decode(byte[] binaryData) {&lt;br /&gt;
      if (binaryData == null)&lt;br /&gt;
          return null;&lt;br /&gt;
      int lengthData   = binaryData.length;&lt;br /&gt;
      if (lengthData % 2 != 0)&lt;br /&gt;
          return null;&lt;br /&gt;
      int lengthDecode = lengthData / 2;&lt;br /&gt;
      byte[] decodedData = new byte[lengthDecode];&lt;br /&gt;
      for( int i = 0; i&amp;lt;lengthDecode; i++ ){&lt;br /&gt;
          if (!isHex(binaryData[i*2]) || !isHex(binaryData[i*2+1])) {&lt;br /&gt;
              return null;&lt;br /&gt;
          }&lt;br /&gt;
          decodedData[i] = (byte)((hexNumberTable[binaryData[i*2]] &amp;lt;&amp;lt; 4) | hexNumberTable[binaryData[i*2+1]]);&lt;br /&gt;
      }&lt;br /&gt;
      return decodedData;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * byte to be tested if it is Base64 alphabet&lt;br /&gt;
   *&lt;br /&gt;
   * @param octect&lt;br /&gt;
   * @return&lt;br /&gt;
   */&lt;br /&gt;
  static boolean isHex(byte octect) {&lt;br /&gt;
      return (hexNumberTable[octect] != -1);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>