Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 74148F6C3 for ; Thu, 2 May 2013 21:37:40 +0000 (UTC) Received: (qmail 17079 invoked by uid 500); 2 May 2013 21:37:40 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 17013 invoked by uid 500); 2 May 2013 21:37:40 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 17006 invoked by uid 99); 2 May 2013 21:37:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 May 2013 21:37:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 May 2013 21:37:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 950C92388C1C for ; Thu, 2 May 2013 21:36:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r860638 [8/30] - in /websites/production/commons/content/proper/commons-codec: ./ apidocs/ apidocs/resources/ cobertura/ testapidocs/ testapidocs/resources/ Date: Thu, 02 May 2013 21:36:32 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130502213636.950C92388C1C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/commons/content/proper/commons-codec/cobertura/org.apache.commons.codec.binary.BinaryCodec.html ============================================================================== --- websites/production/commons/content/proper/commons-codec/cobertura/org.apache.commons.codec.binary.BinaryCodec.html (original) +++ websites/production/commons/content/proper/commons-codec/cobertura/org.apache.commons.codec.binary.BinaryCodec.html Thu May 2 21:36:30 2013 @@ -87,7 +87,7 @@
  * @version $Id: BinaryCodec.java 1429868 2013-01-07 16:08:05Z ggregory $
 35  
  */
-  36  26
 public class BinaryCodec implements BinaryDecoder, BinaryEncoder {
+  36  13
 public class BinaryCodec implements BinaryDecoder, BinaryEncoder {
 37  
     /*
 38   @@ -98,12 +98,12 @@
      */
 41  
     /** Empty char array. */
-  42  2
     private static final char[] EMPTY_CHAR_ARRAY = new char[0];
+  42  1
     private static final char[] EMPTY_CHAR_ARRAY = new char[0];
 43  
 
 44  
     /** Empty byte array. */
-  45  2
     private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
+  45  1
     private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
 46  
 
 47   @@ -154,7 +154,7 @@
     private static final int BIT_7 = 0x80;
 70  
 
-  71  2
     private static final int[] BITS = {BIT_0, BIT_1, BIT_2, BIT_3, BIT_4, BIT_5, BIT_6, BIT_7};
+  71  1
     private static final int[] BITS = {BIT_0, BIT_1, BIT_2, BIT_3, BIT_4, BIT_5, BIT_6, BIT_7};
 72  
 
 73   @@ -177,7 +177,7 @@
     @Override
 82  
     public byte[] encode(final byte[] raw) {
-  83  54
         return toAsciiBytes(raw);
+  83  27
         return toAsciiBytes(raw);
 84  
     }
 85   @@ -206,11 +206,11 @@
     @Override
 97  
     public Object encode(final Object raw) throws EncoderException {
-  98  56
         if (!(raw instanceof byte[])) {
-  99  2
             throw new EncoderException("argument not a byte array");
+  98  28
         if (!(raw instanceof byte[])) {
+  99  1
             throw new EncoderException("argument not a byte array");
 100  
         }
-  101  54
         return toAsciiChars((byte[]) raw);
+  101  27
         return toAsciiChars((byte[]) raw);
 102  
     }
 103   @@ -239,23 +239,23 @@
     @Override
 115  
     public Object decode(final Object ascii) throws DecoderException {
-  116  114
         if (ascii == null) {
-  117  4
             return EMPTY_BYTE_ARRAY;
+  116  57
         if (ascii == null) {
+  117  2
             return EMPTY_BYTE_ARRAY;
 118  
         }
-  119  110
         if (ascii instanceof byte[]) {
-  120  36
             return fromAscii((byte[]) ascii);
+  119  55
         if (ascii instanceof byte[]) {
+  120  18
             return fromAscii((byte[]) ascii);
 121  
         }
-  122  74
         if (ascii instanceof char[]) {
-  123  36
             return fromAscii((char[]) ascii);
+  122  37
         if (ascii instanceof char[]) {
+  123  18
             return fromAscii((char[]) ascii);
 124  
         }
-  125  38
         if (ascii instanceof String) {
-  126  36
             return fromAscii(((String) ascii).toCharArray());
+  125  19
         if (ascii instanceof String) {
+  126  18
             return fromAscii(((String) ascii).toCharArray());
 127  
         }
-  128  2
         throw new DecoderException("argument not a byte array");
+  128  1
         throw new DecoderException("argument not a byte array");
 129  
     }
 130   @@ -280,7 +280,7 @@
     @Override
 140  
     public byte[] decode(final byte[] ascii) {
-  141  38
         return fromAscii(ascii);
+  141  19
         return fromAscii(ascii);
 142  
     }
 143   @@ -303,11 +303,11 @@
      */
 152  
     public byte[] toByteArray(final String ascii) {
-  153  38
         if (ascii == null) {
-  154  2
             return EMPTY_BYTE_ARRAY;
+  153  19
         if (ascii == null) {
+  154  1
             return EMPTY_BYTE_ARRAY;
 155  
         }
-  156  36
         return fromAscii(ascii.toCharArray());
+  156  18
         return fromAscii(ascii.toCharArray());
 157  
     }
 158   @@ -338,13 +338,13 @@
      */
 171  
     public static byte[] fromAscii(final char[] ascii) {
-  172  150
         if (ascii == null || ascii.length == 0) {
-  173  6
             return EMPTY_BYTE_ARRAY;
+  172  75
         if (ascii == null || ascii.length == 0) {
+  173  3
             return EMPTY_BYTE_ARRAY;
 174  
         }
 175  
         // get length/8 times bytes with 3 bit shifts to the right of the length
-  176  144
         final byte[] l_raw = new byte[ascii.length >> 3];
+  176  72
         final byte[] l_raw = new byte[ascii.length >> 3];
 177  
         /*
 178   @@ -353,17 +353,17 @@
          * loop.
 180  
          */
-  181  360
         for (int ii = 0, jj = ascii.length - 1; ii < l_raw.length; ii++, jj -= 8) {
-  182  1944
             for (int bits = 0; bits < BITS.length; ++bits) {
-  183  1728
                 if (ascii[jj - bits] == '1') {
-  184  1152
                     l_raw[ii] |= BITS[bits];
+  181  180
         for (int ii = 0, jj = ascii.length - 1; ii < l_raw.length; ii++, jj -= 8) {
+  182  972
             for (int bits = 0; bits < BITS.length; ++bits) {
+  183  864
                 if (ascii[jj - bits] == '1') {
+  184  576
                     l_raw[ii] |= BITS[bits];
 185  
                 }
 186  
             }
 187  
         }
-  188  144
         return l_raw;
+  188  72
         return l_raw;
 189  
     }
 190   @@ -384,13 +384,13 @@
      */
 198  
     public static byte[] fromAscii(final byte[] ascii) {
-  199  116
         if (isEmpty(ascii)) {
-  200  8
             return EMPTY_BYTE_ARRAY;
+  199  58
         if (isEmpty(ascii)) {
+  200  4
             return EMPTY_BYTE_ARRAY;
 201  
         }
 202  
         // get length/8 times bytes with 3 bit shifts to the right of the length
-  203  108
         final byte[] l_raw = new byte[ascii.length >> 3];
+  203  54
         final byte[] l_raw = new byte[ascii.length >> 3];
 204  
         /*
 205   @@ -399,17 +399,17 @@
          * loop.
 207  
          */
-  208  270
         for (int ii = 0, jj = ascii.length - 1; ii < l_raw.length; ii++, jj -= 8) {
-  209  1458
             for (int bits = 0; bits < BITS.length; ++bits) {
-  210  1296
                 if (ascii[jj - bits] == '1') {
-  211  864
                     l_raw[ii] |= BITS[bits];
+  208  135
         for (int ii = 0, jj = ascii.length - 1; ii < l_raw.length; ii++, jj -= 8) {
+  209  729
             for (int bits = 0; bits < BITS.length; ++bits) {
+  210  648
                 if (ascii[jj - bits] == '1') {
+  211  432
                     l_raw[ii] |= BITS[bits];
 212  
                 }
 213  
             }
 214  
         }
-  215  108
         return l_raw;
+  215  54
         return l_raw;
 216  
     }
 217   @@ -430,7 +430,7 @@
      */
 225  
     private static boolean isEmpty(final byte[] array) {
-  226  384
         return array == null || array.length == 0;
+  226  192
         return array == null || array.length == 0;
 227  
     }
 228   @@ -455,13 +455,13 @@
      */
 238  
     public static byte[] toAsciiBytes(final byte[] raw) {
-  239  108
         if (isEmpty(raw)) {
-  240  4
             return EMPTY_BYTE_ARRAY;
+  239  54
         if (isEmpty(raw)) {
+  240  2
             return EMPTY_BYTE_ARRAY;
 241  
         }
 242  
         // get 8 times the bytes with 3 bit shifts to the left of the length
-  243  104
         final byte[] l_ascii = new byte[raw.length << 3];
+  243  52
         final byte[] l_ascii = new byte[raw.length << 3];
 244  
         /*
 245   @@ -470,20 +470,20 @@
          * loop.
 247  
          */
-  248  276
         for (int ii = 0, jj = l_ascii.length - 1; ii < raw.length; ii++, jj -= 8) {
-  249  1548
             for (int bits = 0; bits < BITS.length; ++bits) {
-  250  1376
                 if ((raw[ii] & BITS[bits]) == 0) {
-  251  688
                     l_ascii[jj - bits] = '0';
+  248  138
         for (int ii = 0, jj = l_ascii.length - 1; ii < raw.length; ii++, jj -= 8) {
+  249  774
             for (int bits = 0; bits < BITS.length; ++bits) {
+  250  688
                 if ((raw[ii] & BITS[bits]) == 0) {
+  251  344
                     l_ascii[jj - bits] = '0';
 252  
                 } else {
-  253  688
                     l_ascii[jj - bits] = '1';
+  253  344
                     l_ascii[jj - bits] = '1';
 254  
                 }
 255  
             }
 256  
         }
-  257  104
         return l_ascii;
+  257  52
         return l_ascii;
 258  
     }
 259   @@ -506,13 +506,13 @@
      */
 268  
     public static char[] toAsciiChars(final byte[] raw) {
-  269  160
         if (isEmpty(raw)) {
-  270  4
             return EMPTY_CHAR_ARRAY;
+  269  80
         if (isEmpty(raw)) {
+  270  2
             return EMPTY_CHAR_ARRAY;
 271  
         }
 272  
         // get 8 times the bytes with 3 bit shifts to the left of the length
-  273  156
         final char[] l_ascii = new char[raw.length << 3];
+  273  78
         final char[] l_ascii = new char[raw.length << 3];
 274  
         /*
 275   @@ -521,20 +521,20 @@
          * loop.
 277  
          */
-  278  414
         for (int ii = 0, jj = l_ascii.length - 1; ii < raw.length; ii++, jj -= 8) {
-  279  2322
             for (int bits = 0; bits < BITS.length; ++bits) {
-  280  2064
                 if ((raw[ii] & BITS[bits]) == 0) {
-  281  1032
                     l_ascii[jj - bits] = '0';
+  278  207
         for (int ii = 0, jj = l_ascii.length - 1; ii < raw.length; ii++, jj -= 8) {
+  279  1161
             for (int bits = 0; bits < BITS.length; ++bits) {
+  280  1032
                 if ((raw[ii] & BITS[bits]) == 0) {
+  281  516
                     l_ascii[jj - bits] = '0';
 282  
                 } else {
-  283  1032
                     l_ascii[jj - bits] = '1';
+  283  516
                     l_ascii[jj - bits] = '1';
 284  
                 }
 285  
             }
 286  
         }
-  287  156
         return l_ascii;
+  287  78
         return l_ascii;
 288  
     }
 289   @@ -557,13 +557,13 @@
      */
 298  
     public static String toAsciiString(final byte[] raw) {
-  299  52
         return new String(toAsciiChars(raw));
+  299  26
         return new String(toAsciiChars(raw));
 300  
     }
 301  
 }
- + \ No newline at end of file