mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Use separate threads for decryption and decompression
This commit is contained in:
parent
c941d086d9
commit
1a90b6d942
8 changed files with 47 additions and 37 deletions
|
|
@ -141,8 +141,6 @@ namespace Ionic.Zlib
|
|||
return oldCheck;
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
internal int Process(int r)
|
||||
{
|
||||
int t; // temporary storage
|
||||
|
|
@ -676,7 +674,6 @@ namespace Ionic.Zlib
|
|||
}
|
||||
|
||||
// copy as much as possible from the sliding window to the output area
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
internal int Flush(int r)
|
||||
{
|
||||
int nBytes;
|
||||
|
|
@ -803,7 +800,7 @@ namespace Ionic.Zlib
|
|||
tree = null;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
|
||||
internal int Process(InflateBlocks blocks, int r)
|
||||
{
|
||||
int j; // temporary storage
|
||||
|
|
@ -1165,8 +1162,7 @@ namespace Ionic.Zlib
|
|||
// (the maximum string length) and number of input bytes available
|
||||
// at least ten. The ten bytes are six bytes for the longest length/
|
||||
// distance pair plus four bytes for overloading the bit buffer.
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
internal int InflateFast(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index, InflateBlocks s, ZlibCodec z)
|
||||
{
|
||||
int t; // temporary pointer
|
||||
|
|
@ -1515,7 +1511,6 @@ namespace Ionic.Zlib
|
|||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
internal int Inflate(FlushType flush)
|
||||
{
|
||||
int b;
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ namespace Ionic.Zlib
|
|||
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
private void finish()
|
||||
{
|
||||
if (_z == null) return;
|
||||
|
|
@ -301,7 +300,6 @@ namespace Ionic.Zlib
|
|||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
public override void Close()
|
||||
{
|
||||
if (_stream == null) return;
|
||||
|
|
@ -416,7 +414,6 @@ namespace Ionic.Zlib
|
|||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
public override System.Int32 Read(System.Byte[] buffer, System.Int32 offset, System.Int32 count)
|
||||
{
|
||||
// According to MS documentation, any implementation of the IO.Stream.Read function must:
|
||||
|
|
|
|||
|
|
@ -352,7 +352,6 @@ namespace Ionic.Zlib
|
|||
/// </example>
|
||||
/// <param name="flush">The flush to use when inflating.</param>
|
||||
/// <returns>Z_OK if everything goes well.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
public int Inflate(FlushType flush)
|
||||
{
|
||||
if (istate == null)
|
||||
|
|
|
|||
|
|
@ -410,7 +410,6 @@ namespace Ionic.Zlib
|
|||
/// <param name="disposing">
|
||||
/// indicates whether the Dispose method was invoked by user code.
|
||||
/// </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
try
|
||||
|
|
@ -545,10 +544,9 @@ namespace Ionic.Zlib
|
|||
/// <param name="count">the number of bytes to read.</param>
|
||||
///
|
||||
/// <returns>the number of bytes read</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (_disposed) throw new ObjectDisposedException("ZlibStream");
|
||||
if (_disposed) throw new ObjectDisposedException("ZlibStream");
|
||||
return _baseStream.Read(buffer, offset, count);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue