Skip to content

Commit 0413250

Browse files
author
gefeili
committed
Add StreamUtil.readBodyLen function
1 parent 6a6c0be commit 0413250

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public Packet readPacket()
203203
{
204204
tag = hdr & 0x3f;
205205
boolean[] flags = new boolean[3];
206-
bodyLen = StreamUtil.readBodyLen(this, this, flags);
206+
bodyLen = StreamUtil.readBodyLen(this, flags);
207207
partial = flags[2];
208208
}
209209
else
@@ -376,7 +376,7 @@ private int loadDataLength()
376376
throws IOException
377377
{
378378
boolean[] flags = new boolean[3];
379-
dataLength = StreamUtil.readBodyLen(in, in, flags);
379+
dataLength = StreamUtil.readBodyLen(in, flags);
380380
if (flags[0])
381381
{
382382
return -1;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public SignatureSubpacket readPacket()
6969
throws IOException
7070
{
7171
boolean[] flags = new boolean[3];
72-
int bodyLen = StreamUtil.readBodyLen(this, in, flags);
72+
int bodyLen = StreamUtil.readBodyLen(this, flags);
7373
if (flags[0])
7474
{
7575
return null;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int read4OctetLength(InputStream in)
154154
* flags[1] indicates (is)longLength = true
155155
* flags[2] indicate partial = true
156156
*/
157-
static int readBodyLen(InputStream in, InputStream subIn, boolean[] flags)
157+
static int readBodyLen(InputStream in, boolean[] flags)
158158
throws IOException
159159
{
160160
Arrays.fill(flags, false);
@@ -170,7 +170,7 @@ static int readBodyLen(InputStream in, InputStream subIn, boolean[] flags)
170170
}
171171
else if (l <= 223)
172172
{
173-
bodyLen = ((l - 192) << 8) + (subIn.read()) + 192;
173+
bodyLen = ((l - 192) << 8) + (in.read()) + 192;
174174
}
175175
else if (l == 255)
176176
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public UserAttributeSubpacket readPacket()
7171
throws IOException
7272
{
7373
boolean[] flags = new boolean[3];
74-
int bodyLen = StreamUtil.readBodyLen(this, in, flags);
74+
int bodyLen = StreamUtil.readBodyLen(this, flags);
7575
if (flags[0])
7676
{
7777
return null;

0 commit comments

Comments
 (0)