X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fbouncycastle%2Fasn1%2FBERInputStream.java;fp=src%2Forg%2Fbouncycastle%2Fasn1%2FBERInputStream.java;h=af714c9c55d5588b55ecf790bcc456bc5cbe8034;hb=03f6ddc710c59aab2b931cb87ecf48173b9a7d55;hp=fd960eca276c4a6fe94f625ada7d2daa8e692cb1;hpb=2fa20bbe798c44d0443d7b80d8dbcf7eb13fff4a;p=org.ibex.core.git diff --git a/src/org/bouncycastle/asn1/BERInputStream.java b/src/org/bouncycastle/asn1/BERInputStream.java index fd960ec..af714c9 100644 --- a/src/org/bouncycastle/asn1/BERInputStream.java +++ b/src/org/bouncycastle/asn1/BERInputStream.java @@ -7,15 +7,15 @@ import java.util.*; public class BERInputStream extends DERInputStream { - private DERObject END_OF_STREAM = new DERObject() { - void encode( - DEROutputStream out) - throws IOException - { - throw new IOException("Eeek!"); - } - - }; + private DERObject END_OF_STREAM = new DERObject() { + void encode( + DEROutputStream out) + throws IOException + { + throw new IOException("Eeek!"); + } + + }; public BERInputStream( InputStream is) { @@ -35,10 +35,10 @@ public class BERInputStream while ((b = read()) >= 0) { - if (b1 == 0 && b == 0) - { - break; - } + if (b1 == 0 && b == 0) + { + break; + } bOut.write(b1); b1 = b; @@ -47,25 +47,25 @@ public class BERInputStream return bOut.toByteArray(); } - private BERConstructedOctetString buildConstructedOctetString() - throws IOException - { + private BERConstructedOctetString buildConstructedOctetString() + throws IOException + { Vector octs = new Vector(); - for (;;) - { - DERObject o = readObject(); + for (;;) + { + DERObject o = readObject(); - if (o == END_OF_STREAM) - { - break; - } + if (o == END_OF_STREAM) + { + break; + } octs.addElement(o); - } + } - return new BERConstructedOctetString(octs); - } + return new BERConstructedOctetString(octs); + } public DERObject readObject() throws IOException @@ -87,35 +87,35 @@ public class BERInputStream case SEQUENCE | CONSTRUCTED: BERConstructedSequence seq = new BERConstructedSequence(); - for (;;) - { - DERObject obj = readObject(); - - if (obj == END_OF_STREAM) - { - break; - } - - seq.addObject(obj); - } - return seq; + for (;;) + { + DERObject obj = readObject(); + + if (obj == END_OF_STREAM) + { + break; + } + + seq.addObject(obj); + } + return seq; case OCTET_STRING | CONSTRUCTED: - return buildConstructedOctetString(); + return buildConstructedOctetString(); case SET | CONSTRUCTED: DEREncodableVector v = new DEREncodableVector(); - for (;;) - { - DERObject obj = readObject(); - - if (obj == END_OF_STREAM) - { - break; - } - - v.add(obj); - } - return new BERSet(v); + for (;;) + { + DERObject obj = readObject(); + + if (obj == END_OF_STREAM) + { + break; + } + + v.add(obj); + } + return new BERSet(v); default: // // with tagged object tag number is bottom 5 bits @@ -140,9 +140,9 @@ public class BERInputStream // // either constructed or explicitly tagged // - DERObject dObj = readObject(); + DERObject dObj = readObject(); - if (dObj == END_OF_STREAM) // empty tag! + if (dObj == END_OF_STREAM) // empty tag! { return new DERTaggedObject(tag & 0x1f); } @@ -189,7 +189,7 @@ public class BERInputStream readFully(bytes); - return buildObject(tag, bytes); + return buildObject(tag, bytes); } } }