projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2003/06/16 08:03:13
[org.ibex.core.git]
/
src
/
org
/
bouncycastle
/
asn1
/
BERInputStream.java
diff --git
a/src/org/bouncycastle/asn1/BERInputStream.java
b/src/org/bouncycastle/asn1/BERInputStream.java
index
fd960ec
..
af714c9
100644
(file)
--- 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
{
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)
{
public BERInputStream(
InputStream is)
{
@@
-35,10
+35,10
@@
public class BERInputStream
while ((b = read()) >= 0)
{
while ((b = read()) >= 0)
{
- if (b1 == 0 && b == 0)
- {
- break;
- }
+ if (b1 == 0 && b == 0)
+ {
+ break;
+ }
bOut.write(b1);
b1 = b;
bOut.write(b1);
b1 = b;
@@
-47,25
+47,25
@@
public class BERInputStream
return bOut.toByteArray();
}
return bOut.toByteArray();
}
- private BERConstructedOctetString buildConstructedOctetString()
- throws IOException
- {
+ private BERConstructedOctetString buildConstructedOctetString()
+ throws IOException
+ {
Vector octs = new Vector();
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);
octs.addElement(o);
- }
+ }
- return new BERConstructedOctetString(octs);
- }
+ return new BERConstructedOctetString(octs);
+ }
public DERObject readObject()
throws IOException
public DERObject readObject()
throws IOException
@@
-87,35
+87,35
@@
public class BERInputStream
case SEQUENCE | CONSTRUCTED:
BERConstructedSequence seq = new BERConstructedSequence();
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:
case OCTET_STRING | CONSTRUCTED:
- return buildConstructedOctetString();
+ return buildConstructedOctetString();
case SET | CONSTRUCTED:
DEREncodableVector v = new DEREncodableVector();
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
default:
//
// with tagged object tag number is bottom 5 bits
@@
-140,9
+140,9
@@
public class BERInputStream
//
// either constructed or explicitly tagged
//
//
// 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);
}
{
return new DERTaggedObject(tag & 0x1f);
}
@@
-189,7
+189,7
@@
public class BERInputStream
readFully(bytes);
readFully(bytes);
- return buildObject(tag, bytes);
+ return buildObject(tag, bytes);
}
}
}
}
}
}