Imported GNU Classpath 0.90

Imported GNU Classpath 0.90
       * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
       * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
       * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
       * java/lang/Math.java: New override file.
       * java/lang/Character.java: Merged from Classpath.
       (start, end): Now 'int's.
       (canonicalName): New field.
       (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
       (UnicodeBlock): Added argument.
       (of): New overload.
       (forName): New method.
       Updated unicode blocks.
       (sets): Updated.
       * sources.am: Regenerated.
       * Makefile.in: Likewise.

From-SVN: r111942
This commit is contained in:
Mark Wielaard
2006-03-10 21:46:48 +00:00
parent 27079765d0
commit 8aa540d2f7
1367 changed files with 188789 additions and 22762 deletions
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.java.security.der;
import gnu.java.security.x509.Util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -108,7 +110,9 @@ public class DERValue implements DER
}
catch (IOException ioe)
{
encoded = new byte[0];
IllegalArgumentException iae = new IllegalArgumentException ();
iae.initCause (ioe);
throw iae;
}
}
return length;
@@ -138,7 +142,9 @@ public class DERValue implements DER
}
catch (IOException ioe)
{
encoded = new byte[0];
IllegalArgumentException iae = new IllegalArgumentException ();
iae.initCause (ioe);
throw iae;
}
}
return (byte[]) encoded.clone();
@@ -156,7 +162,9 @@ public class DERValue implements DER
}
catch (IOException ioe)
{
encoded = new byte[0];
IllegalArgumentException iae = new IllegalArgumentException ();
iae.initCause (ioe);
throw iae;
}
}
return encoded.length;
@@ -164,7 +172,18 @@ public class DERValue implements DER
public String toString()
{
return "DERValue [ tag=" + tag + ", class=" + tagClass + ", constructed="
+ constructed + ", value=" + value + " ]";
String start = "DERValue ( [";
if (tagClass == DER.UNIVERSAL)
start = start + "UNIVERSAL ";
else if (tagClass == DER.PRIVATE)
start = start + "PRIVATE ";
else if (tagClass == DER.APPLICATION)
start = start + "APPLICATION ";
start = start + tag + "] constructed=" + constructed + ", value=";
if (constructed)
start = start + "\n" + Util.hexDump(getEncoded(), "\t");
else
start = start + value;
return start + " )";
}
}
@@ -84,6 +84,12 @@ public class DERWriter implements DER
public static int write(OutputStream out, DERValue object)
throws IOException
{
if (DER.CONSTRUCTED_VALUE.equals (object.getValue ()))
{
out.write (object.getEncoded ());
return object.getLength ();
}
out.write(object.getExternalTag());
Object value = object.getValue();
if (value == null)
@@ -216,10 +222,10 @@ public class DERWriter implements DER
throws IOException
{
byte[] buf = bs.getShiftedByteArray();
out.write(buf.length + 1);
writeLength(out, buf.length + 1);
out.write(bs.getIgnoredBits());
out.write(buf);
return buf.length;
return buf.length + 1;
}
private static int writeString(OutputStream out, int tag, String str)