Skip to content

Commit bb43a69

Browse files
committed
Typo.
1 parent 2f10765 commit bb43a69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Org.Security.Cryptography.X509Extensions/X509RsaAesStreamEncryptionExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,19 @@ static void WriteLengthAndBytes(this Stream outputStream, byte[] bytes)
164164
outputStream.Write(bytes, 0, bytes.Length);
165165
}
166166

167-
static byte[] ReadLengthAndBytes(this Stream outputStream)
167+
static byte[] ReadLengthAndBytes(this Stream inputStream)
168168
{
169-
if (null == outputStream) throw new ArgumentNullException(nameof(outputStream));
169+
if (null == inputStream) throw new ArgumentNullException(nameof(inputStream));
170170

171171
// Read an Int32, exactly four bytes.
172172
var arrLength = new byte[4];
173-
var bytesRead = outputStream.Read(arrLength, 0, 4);
173+
var bytesRead = inputStream.Read(arrLength, 0, 4);
174174
if (bytesRead != 4) throw new Exception("Unexpected end of InputStream. Expecting 4 bytes.");
175175

176176
// Read suggested no of bytes...
177177
var length = BitConverter.ToInt32(arrLength, 0);
178178
var bytes = new byte[length];
179-
bytesRead = outputStream.Read(bytes, 0, bytes.Length);
179+
bytesRead = inputStream.Read(bytes, 0, bytes.Length);
180180
if (bytesRead != bytes.Length) throw new Exception($"Unexpected end of input stream. Expecting {bytes.Length:#,0} bytes.");
181181

182182
return bytes;

0 commit comments

Comments
 (0)