mirror of
https://github.com/wismna/ModernKeePassLib.git
synced 2025-10-03 15:40:20 -04:00
Update Lib to version 2.44
Update nuget packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
KeePass Password Safe - The Open-Source Password Manager
|
||||
Copyright (C) 2003-2019 Dominik Reichl <dominik.reichl@t-online.de>
|
||||
Copyright (C) 2003-2020 Dominik Reichl <dominik.reichl@t-online.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -597,20 +597,34 @@ namespace ModernKeePassLib.Utility
|
||||
if(sSource == null) throw new ArgumentNullException("sSource");
|
||||
if(sTarget == null) throw new ArgumentNullException("sTarget");
|
||||
|
||||
const int nBufSize = 4096;
|
||||
byte[] pbBuf = new byte[nBufSize];
|
||||
const int cbBuf = 4096;
|
||||
byte[] pbBuf = new byte[cbBuf];
|
||||
|
||||
while(true)
|
||||
{
|
||||
int nRead = sSource.Read(pbBuf, 0, nBufSize);
|
||||
if(nRead == 0) break;
|
||||
int cbRead = sSource.Read(pbBuf, 0, cbBuf);
|
||||
if(cbRead == 0) break;
|
||||
|
||||
sTarget.Write(pbBuf, 0, nRead);
|
||||
sTarget.Write(pbBuf, 0, cbRead);
|
||||
}
|
||||
|
||||
// Do not close any of the streams
|
||||
}
|
||||
|
||||
public static byte[] Read(Stream s)
|
||||
{
|
||||
if(s == null) throw new ArgumentNullException("s");
|
||||
|
||||
byte[] pb;
|
||||
using(MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
MemUtil.CopyStream(s, ms);
|
||||
pb = ms.ToArray();
|
||||
}
|
||||
|
||||
return pb;
|
||||
}
|
||||
|
||||
public static byte[] Read(Stream s, int nCount)
|
||||
{
|
||||
if(s == null) throw new ArgumentNullException("s");
|
||||
|
Reference in New Issue
Block a user