--- /home/tromey/gnu/Nightly/classpath/classpath/gnu/java/security/der/DERReader.java 2004-11-08 02:18:56.000000000 -0700 +++ gnu/java/security/der/DERReader.java 2004-08-31 02:19:47.000000000 -0600 @@ -62,15 +62,15 @@ * * @author Casey Marshall (csm@gnu.org) */ -public class DERReader implements DER +public final class DERReader implements DER { // Fields. // ------------------------------------------------------------------------ - protected InputStream in; + private InputStream in; - protected final ByteArrayOutputStream encBuf; + private final ByteArrayOutputStream encBuf; // Constructor. // ------------------------------------------------------------------------ @@ -185,26 +185,6 @@ return value; } - protected int readLength() throws IOException - { - int i = in.read(); - if (i == -1) - throw new EOFException(); - encBuf.write(i); - if ((i & ~0x7F) == 0) - { - return i; - } - else if (i < 0xFF) - { - byte[] octets = new byte[i & 0x7F]; - in.read(octets); - encBuf.write(octets); - return new BigInteger(1, octets).intValue(); - } - throw new DEREncodingException(); - } - // Own methods. // ------------------------------------------------------------------------ @@ -256,6 +236,26 @@ } } + private int readLength() throws IOException + { + int i = in.read(); + if (i == -1) + throw new EOFException(); + encBuf.write(i); + if ((i & ~0x7F) == 0) + { + return i; + } + else if (i < 0xFF) + { + byte[] octets = new byte[i & 0x7F]; + in.read(octets); + encBuf.write(octets); + return new BigInteger(1, octets).intValue(); + } + throw new DEREncodingException(); + } + private static String makeString(int tag, byte[] value) throws IOException {