You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by ra...@apache.org on 2006/01/08 19:52:23 UTC
svn commit: r367069 -
/xml/security/trunk/src/org/apache/xml/security/utils/Base64.java
Author: raul
Date: Sun Jan 8 10:52:18 2006
New Revision: 367069
URL: http://svn.apache.org/viewcvs?rev=367069&view=rev
Log:
Remove debug from base64 class.
Modified:
xml/security/trunk/src/org/apache/xml/security/utils/Base64.java
Modified: xml/security/trunk/src/org/apache/xml/security/utils/Base64.java
URL: http://svn.apache.org/viewcvs/xml/security/trunk/src/org/apache/xml/security/utils/Base64.java?rev=367069&r1=367068&r2=367069&view=diff
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/utils/Base64.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/utils/Base64.java Sun Jan 8 10:52:18 2006
@@ -342,8 +342,7 @@
static private final int SIXTEENBIT = 16;
static private final int FOURBYTE = 4;
static private final int SIGN = -128;
- static private final char PAD = '=';
- static private final boolean fDebug = false;
+ static private final char PAD = '=';
static final private byte [] base64Alphabet = new byte[BASELENGTH];
static final private char [] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
@@ -430,9 +429,7 @@
int encodedIndex = 0;
int dataIndex = 0;
int i = 0;
- if (fDebug) {
- System.out.println("number of triplets = " + numberTriplets );
- }
+
for (int line = 0; line < numberLines; line++) {
for (int quartet = 0; quartet < 19; quartet++) {
@@ -440,9 +437,6 @@
b2 = binaryData[dataIndex++];
b3 = binaryData[dataIndex++];
- if (fDebug) {
- System.out.println( "b1= " + b1 +", b2= " + b2 + ", b3= " + b3 );
- }
l = (byte)(b2 & 0x0f);
k = (byte)(b1 & 0x03);
@@ -452,11 +446,6 @@
byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);
byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);
- if (fDebug) {
- System.out.println( "val2 = " + val2 );
- System.out.println( "k4 = " + (k<<4));
- System.out.println( "vak = " + (val2 | (k<<4)));
- }
encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];
encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];
@@ -473,9 +462,6 @@
b2 = binaryData[dataIndex++];
b3 = binaryData[dataIndex++];
- if (fDebug) {
- System.out.println( "b1= " + b1 +", b2= " + b2 + ", b3= " + b3 );
- }
l = (byte)(b2 & 0x0f);
k = (byte)(b1 & 0x03);
@@ -485,11 +471,6 @@
byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);
byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);
- if (fDebug) {
- System.out.println( "val2 = " + val2 );
- System.out.println( "k4 = " + (k<<4));
- System.out.println( "vak = " + (val2 | (k<<4)));
- }
encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];
encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];
@@ -501,11 +482,7 @@
if (fewerThan24bits == EIGHTBIT) {
b1 = binaryData[dataIndex];
k = (byte) ( b1 &0x03 );
- if (fDebug) {
- System.out.println("b1=" + b1);
- System.out.println("b1<<2 = " + (b1>>2) );
- }
- byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
+ byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];
encodedData[encodedIndex++] = lookUpBase64Alphabet[ k<<4 ];
encodedData[encodedIndex++] = PAD;