Skip to content

Commit 4919f45

Browse files
committed
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
2 parents e05d3f5 + 06082b1 commit 4919f45

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pg/src/main/java/org/bouncycastle/bcpg/BCPGInputStream.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@ public Packet readPacket()
239239
}
240240
else
241241
{
242-
objStream = new BCPGInputStream(
243-
new BufferedInputStream(new PartialInputStream(this, partial, bodyLen)));
242+
// assert !this.next;
243+
PartialInputStream pis = new PartialInputStream(this.in, partial, bodyLen);
244+
objStream = new BCPGInputStream(new BufferedInputStream(pis));
244245
}
245246

246247
switch (tag)
@@ -339,14 +340,11 @@ public void close()
339340
private static class PartialInputStream
340341
extends InputStream
341342
{
342-
private BCPGInputStream in;
343+
private final InputStream in;
343344
private boolean partial;
344345
private int dataLength;
345346

346-
PartialInputStream(
347-
BCPGInputStream in,
348-
boolean partial,
349-
int dataLength)
347+
PartialInputStream(InputStream in, boolean partial, int dataLength)
350348
{
351349
this.in = in;
352350
this.partial = partial;

0 commit comments

Comments
 (0)