Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DispatchChannelSink.cs
- UInt64Storage.cs
- DoubleAnimationUsingPath.cs
- GridViewUpdatedEventArgs.cs
- TextTreeObjectNode.cs
- CriticalFinalizerObject.cs
- TabPage.cs
- StorageRoot.cs
- DataTableExtensions.cs
- DataGridViewRow.cs
- PrePostDescendentsWalker.cs
- SecureUICommand.cs
- EntityClientCacheEntry.cs
- SafeBitVector32.cs
- ZeroOpNode.cs
- EntityViewGenerationConstants.cs
- SessionEndingCancelEventArgs.cs
- AudioFormatConverter.cs
- WindowsContainer.cs
- NumberFormatInfo.cs
- UserControlBuildProvider.cs
- ButtonFieldBase.cs
- UnlockInstanceCommand.cs
- HwndHost.cs
- PrePrepareMethodAttribute.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- PlainXmlWriter.cs
- Transform.cs
- ThreadStateException.cs
- FileDialog_Vista_Interop.cs
- Operand.cs
- NetTcpBindingElement.cs
- XmlComplianceUtil.cs
- ClientType.cs
- SqlFacetAttribute.cs
- ScriptIgnoreAttribute.cs
- Baml2006ReaderSettings.cs
- DeleteWorkflowOwnerCommand.cs
- SqlInternalConnectionTds.cs
- TabPage.cs
- NoResizeHandleGlyph.cs
- PrivilegeNotHeldException.cs
- TriState.cs
- DateTimeValueSerializer.cs
- UIElement.cs
- GeometryCollection.cs
- Mappings.cs
- XsltConvert.cs
- XAMLParseException.cs
- OracleMonthSpan.cs
- BasicExpressionVisitor.cs
- ObjectStateEntryDbDataRecord.cs
- WebHeaderCollection.cs
- TypedRowGenerator.cs
- ServiceThrottle.cs
- XPathNavigator.cs
- TabControl.cs
- ContentControl.cs
- SortFieldComparer.cs
- TemplateField.cs
- ZipIOExtraField.cs
- TreeWalkHelper.cs
- RelationshipEntry.cs
- ToolStripContentPanelRenderEventArgs.cs
- HttpResponse.cs
- TextProviderWrapper.cs
- ExecutedRoutedEventArgs.cs
- SQLMembershipProvider.cs
- XmlSchemaProviderAttribute.cs
- ErrorHandlingReceiver.cs
- Point3DKeyFrameCollection.cs
- DeviceFilterEditorDialog.cs
- Resources.Designer.cs
- SQLRoleProvider.cs
- AppDomainFactory.cs
- CodeGen.cs
- Clock.cs
- JapaneseLunisolarCalendar.cs
- EntityDataSourceSelectedEventArgs.cs
- Triplet.cs
- ArgumentValidation.cs
- MD5CryptoServiceProvider.cs
- TokenBasedSetEnumerator.cs
- SubqueryRules.cs
- DragDrop.cs
- GenericPrincipal.cs
- GZipStream.cs
- XPathPatternParser.cs
- FileUtil.cs
- BitmapFrameDecode.cs
- HttpsTransportBindingElement.cs
- StringUtil.cs
- cookie.cs
- SByteStorage.cs
- XPathNodeIterator.cs
- SynchronizationFilter.cs
- Matrix3D.cs
- ContextMenuStrip.cs
- DrawingGroup.cs
- CodeMemberMethod.cs