Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Sys / System / IO / compression / Deflater.cs / 1 / Deflater.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// zlib.h -- interface of the 'zlib' general purpose compression library
// version 1.2.1, November 17th, 2003
//
// Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
//
// ==--==
// Compression engine
namespace System.IO.Compression {
using System;
using System.Diagnostics;
internal class Deflater {
private FastEncoder encoder;
public Deflater(bool doGZip) {
encoder = new FastEncoder(doGZip);
}
public void SetInput(byte[] input, int startIndex, int count) {
encoder.SetInput(input, startIndex, count);
}
public int GetDeflateOutput(byte[] output) {
Debug.Assert(output != null, "Can't pass in a null output buffer!");
return encoder.GetCompressedOutput(output);
}
public bool NeedsInput() {
return encoder.NeedsInput();
}
public int Finish(byte[] output) {
Debug.Assert(output != null, "Can't pass in a null output buffer!");
return encoder.Finish(output);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// zlib.h -- interface of the 'zlib' general purpose compression library
// version 1.2.1, November 17th, 2003
//
// Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
//
// ==--==
// Compression engine
namespace System.IO.Compression {
using System;
using System.Diagnostics;
internal class Deflater {
private FastEncoder encoder;
public Deflater(bool doGZip) {
encoder = new FastEncoder(doGZip);
}
public void SetInput(byte[] input, int startIndex, int count) {
encoder.SetInput(input, startIndex, count);
}
public int GetDeflateOutput(byte[] output) {
Debug.Assert(output != null, "Can't pass in a null output buffer!");
return encoder.GetCompressedOutput(output);
}
public bool NeedsInput() {
return encoder.NeedsInput();
}
public int Finish(byte[] output) {
Debug.Assert(output != null, "Can't pass in a null output buffer!");
return encoder.Finish(output);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataControlReferenceCollection.cs
- TypeSystem.cs
- PolyQuadraticBezierSegment.cs
- EditorResources.cs
- ServiceModelExtensionElement.cs
- FrameworkElementAutomationPeer.cs
- errorpatternmatcher.cs
- SiteMapDataSourceDesigner.cs
- _OSSOCK.cs
- TreeViewDesigner.cs
- ChangeInterceptorAttribute.cs
- MessageQueueKey.cs
- DataSourceXmlAttributeAttribute.cs
- WindowVisualStateTracker.cs
- _OverlappedAsyncResult.cs
- EpmSourcePathSegment.cs
- WinFormsUtils.cs
- ObfuscateAssemblyAttribute.cs
- Stackframe.cs
- InvalidTimeZoneException.cs
- Compress.cs
- RenderDataDrawingContext.cs
- ServiceProviders.cs
- RegisteredDisposeScript.cs
- QilBinary.cs
- BaseCodeDomTreeGenerator.cs
- ToolStripDesignerAvailabilityAttribute.cs
- Propagator.ExtentPlaceholderCreator.cs
- PathTooLongException.cs
- Accessible.cs
- Stream.cs
- IERequestCache.cs
- COM2FontConverter.cs
- webproxy.cs
- ToolStripPanelSelectionBehavior.cs
- TargetConverter.cs
- OracleSqlParser.cs
- NetStream.cs
- Rect.cs
- ComponentResourceKeyConverter.cs
- milrender.cs
- DesignTimeTemplateParser.cs
- GPPOINT.cs
- HttpCacheParams.cs
- FormatVersion.cs
- safesecurityhelperavalon.cs
- Model3DCollection.cs
- CompilerParameters.cs
- BooleanToVisibilityConverter.cs
- ProxyHwnd.cs
- DebuggerAttributes.cs
- BCryptSafeHandles.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- HtmlImage.cs
- WeakReferenceKey.cs
- ContextDataSourceView.cs
- LateBoundBitmapDecoder.cs
- PersonalizationProvider.cs
- StrokeCollection2.cs
- ListSortDescriptionCollection.cs
- SqlDataSourceView.cs
- IpcClientChannel.cs
- XPathDocumentIterator.cs
- ActivityWithResultValueSerializer.cs
- XamlToRtfWriter.cs
- FunctionCommandText.cs
- HtmlListAdapter.cs
- TrustLevelCollection.cs
- TableAutomationPeer.cs
- DataView.cs
- RoleService.cs
- TreeView.cs
- URI.cs
- InputLanguageEventArgs.cs
- DbConnectionPoolCounters.cs
- BitmapSourceSafeMILHandle.cs
- TextControl.cs
- TableColumnCollection.cs
- SoapAttributeOverrides.cs
- FixUp.cs
- SelectQueryOperator.cs
- TypedAsyncResult.cs
- MergeFailedEvent.cs
- DrawListViewSubItemEventArgs.cs
- DetailsView.cs
- WebPartConnectionsDisconnectVerb.cs
- LinkDescriptor.cs
- DesignerForm.cs
- MatrixKeyFrameCollection.cs
- DataPagerFieldCollection.cs
- DataGridViewCellValidatingEventArgs.cs
- HotSpot.cs
- Formatter.cs
- SessionEndingEventArgs.cs
- Intellisense.cs
- DiscoveryClientChannelBase.cs
- PeerApplication.cs
- ReversePositionQuery.cs
- WinFormsComponentEditor.cs
- CodeTryCatchFinallyStatement.cs