Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ResXResourceWriter.cs
- CompressionTransform.cs
- RequestSecurityTokenResponseCollection.cs
- FileDialog_Vista.cs
- formatstringdialog.cs
- AccessorTable.cs
- InfocardClientCredentials.cs
- QilInvokeLateBound.cs
- uribuilder.cs
- ToolboxItem.cs
- TemplateControl.cs
- ConditionalAttribute.cs
- RC2CryptoServiceProvider.cs
- ClientEventManager.cs
- TaskbarItemInfo.cs
- ObfuscationAttribute.cs
- ViewKeyConstraint.cs
- ImageDrawing.cs
- IntSecurity.cs
- GZipDecoder.cs
- ElapsedEventArgs.cs
- ConstraintCollection.cs
- ConnectivityStatus.cs
- PropertyTabAttribute.cs
- ChannelListenerBase.cs
- QuotaThrottle.cs
- IconConverter.cs
- ExtensibleClassFactory.cs
- KnownIds.cs
- TaskbarItemInfo.cs
- GradientStopCollection.cs
- UIElementIsland.cs
- Int16.cs
- ToolBarButtonClickEvent.cs
- RouteValueDictionary.cs
- ParallelSeparator.xaml.cs
- FragmentQueryProcessor.cs
- CheckBoxStandardAdapter.cs
- XPathDocumentBuilder.cs
- ListItemConverter.cs
- Brush.cs
- TextTreeNode.cs
- DesignerAttribute.cs
- Matrix3DStack.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- CustomAttributeBuilder.cs
- SqlDataSourceQueryConverter.cs
- SecurityException.cs
- ReadWriteSpinLock.cs
- StylusDevice.cs
- ExpressionBuilderCollection.cs
- StringValidatorAttribute.cs
- SelectorAutomationPeer.cs
- KeyGestureConverter.cs
- HyperLinkField.cs
- SerialReceived.cs
- RegisteredArrayDeclaration.cs
- TraceEventCache.cs
- _BaseOverlappedAsyncResult.cs
- Zone.cs
- newinstructionaction.cs
- CacheOutputQuery.cs
- LinqTreeNodeEvaluator.cs
- PlanCompiler.cs
- CompiledRegexRunnerFactory.cs
- StreamUpdate.cs
- ToolStripDropDownButton.cs
- CommandEventArgs.cs
- ComponentCache.cs
- QilXmlWriter.cs
- FrameworkElementFactory.cs
- Point3D.cs
- RelationalExpressions.cs
- DbConnectionInternal.cs
- DistinctQueryOperator.cs
- WizardForm.cs
- ParameterCollection.cs
- entitydatasourceentitysetnameconverter.cs
- ListViewUpdatedEventArgs.cs
- WebServiceTypeData.cs
- XPathAncestorIterator.cs
- ObjectHelper.cs
- RegistrationServices.cs
- ParameterReplacerVisitor.cs
- AutomationTextAttribute.cs
- InputBinding.cs
- TableSectionStyle.cs
- filewebresponse.cs
- SystemWebExtensionsSectionGroup.cs
- ControlBindingsCollection.cs
- DataObject.cs
- RectangleF.cs
- XmlSchemaInferenceException.cs
- XmlExpressionDumper.cs
- AdornerDecorator.cs
- CqlWriter.cs
- Line.cs
- SiteMapDataSource.cs
- CodeGotoStatement.cs
- ProfessionalColors.cs