Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / DataOracleClient / System / Data / OracleClient / OracleEncoding.cs / 1 / OracleEncoding.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Data.OracleClient { using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; //--------------------------------------------------------------------- // OracleEncoding // // Implements an Encoding Scheme that works with Oracle's conversions // for the database character set. // sealed internal class OracleEncoding : Encoding { OracleInternalConnection _connection; internal OciHandle Handle { get { OciHandle ociHandle = _connection.SessionHandle; if (null == ociHandle || ociHandle.IsInvalid) { ociHandle = _connection.EnvironmentHandle; } return ociHandle; } } public OracleEncoding(OracleInternalConnection connection) : base() { _connection = connection; } public override int GetByteCount(char[] chars, int index, int count) { int byteCount = GetBytes(chars, index, count, null, 0); return byteCount; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { OciHandle ociHandle = Handle; int byteCount = checked((int)ociHandle.GetBytes(chars, charIndex, unchecked((uint)charCount), bytes, byteIndex)); return byteCount; } public override int GetCharCount(byte[] bytes, int index, int count) { int charCount = GetChars(bytes, index, count, null, 0); return charCount; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { OciHandle ociHandle = Handle; int charCount = checked((int)ociHandle.GetChars(bytes, byteIndex, unchecked((uint)byteCount), chars, charIndex)); return charCount; } public override int GetMaxByteCount(int charCount) { return checked (charCount * 4); } public override int GetMaxCharCount(int byteCount) { return byteCount; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Data.OracleClient { using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; //--------------------------------------------------------------------- // OracleEncoding // // Implements an Encoding Scheme that works with Oracle's conversions // for the database character set. // sealed internal class OracleEncoding : Encoding { OracleInternalConnection _connection; internal OciHandle Handle { get { OciHandle ociHandle = _connection.SessionHandle; if (null == ociHandle || ociHandle.IsInvalid) { ociHandle = _connection.EnvironmentHandle; } return ociHandle; } } public OracleEncoding(OracleInternalConnection connection) : base() { _connection = connection; } public override int GetByteCount(char[] chars, int index, int count) { int byteCount = GetBytes(chars, index, count, null, 0); return byteCount; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { OciHandle ociHandle = Handle; int byteCount = checked((int)ociHandle.GetBytes(chars, charIndex, unchecked((uint)charCount), bytes, byteIndex)); return byteCount; } public override int GetCharCount(byte[] bytes, int index, int count) { int charCount = GetChars(bytes, index, count, null, 0); return charCount; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { OciHandle ociHandle = Handle; int charCount = checked((int)ociHandle.GetChars(bytes, byteIndex, unchecked((uint)byteCount), chars, charIndex)); return charCount; } public override int GetMaxByteCount(int charCount) { return checked (charCount * 4); } public override int GetMaxCharCount(int byteCount) { return byteCount; } } } // 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
- IssuerInformation.cs
- WebAdminConfigurationHelper.cs
- Brush.cs
- UserControl.cs
- Win32.cs
- ConversionContext.cs
- AbstractSvcMapFileLoader.cs
- WebPartConnectionsCancelVerb.cs
- TraceListeners.cs
- Attributes.cs
- TypeConverterHelper.cs
- HostedController.cs
- NodeInfo.cs
- DesignColumn.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- XPathNavigator.cs
- SqlErrorCollection.cs
- StrokeSerializer.cs
- Rules.cs
- Tokenizer.cs
- WorkflowCommandExtensionItem.cs
- GroupQuery.cs
- Type.cs
- GlyphTypeface.cs
- SelectQueryOperator.cs
- IOThreadScheduler.cs
- ServiceModelSectionGroup.cs
- _BasicClient.cs
- DataGridViewTopLeftHeaderCell.cs
- StructuredTypeEmitter.cs
- DataGridCaption.cs
- BinaryConverter.cs
- ErrorLog.cs
- PackWebRequestFactory.cs
- ArraySubsetEnumerator.cs
- EditableTreeList.cs
- Repeater.cs
- XmlTextReaderImpl.cs
- CompilationUtil.cs
- DescendantOverDescendantQuery.cs
- MbpInfo.cs
- LinkedResource.cs
- SystemTcpStatistics.cs
- XmlBinaryReader.cs
- KeyEventArgs.cs
- OleDbErrorCollection.cs
- WizardForm.cs
- XsltSettings.cs
- TreeViewAutomationPeer.cs
- ResourcePool.cs
- FontDriver.cs
- InheritablePropertyChangeInfo.cs
- BufferedStream.cs
- InternalMappingException.cs
- InvalidFilterCriteriaException.cs
- PartialTrustHelpers.cs
- EditorZone.cs
- InputProcessorProfilesLoader.cs
- OdbcCommand.cs
- RelationshipConstraintValidator.cs
- VariableAction.cs
- DispatcherEventArgs.cs
- Attributes.cs
- SdlChannelSink.cs
- SingleQueryOperator.cs
- DrawingAttributeSerializer.cs
- SchemaMapping.cs
- ExpressionBuilderContext.cs
- LoginUtil.cs
- HttpCachePolicy.cs
- XsltCompileContext.cs
- TriggerActionCollection.cs
- SvcMapFile.cs
- WriteableBitmap.cs
- ClientOperationFormatterProvider.cs
- TextServicesDisplayAttributePropertyRanges.cs
- SafeSystemMetrics.cs
- InternalBufferOverflowException.cs
- HtmlDocument.cs
- Stack.cs
- Guid.cs
- NativeStructs.cs
- MemoryStream.cs
- SessionEndingCancelEventArgs.cs
- httpapplicationstate.cs
- Missing.cs
- EntityParameterCollection.cs
- WindowsSolidBrush.cs
- WorkflowMessageEventArgs.cs
- Floater.cs
- ReadOnlyAttribute.cs
- CodeTypeDeclarationCollection.cs
- SqlHelper.cs
- ComplexTypeEmitter.cs
- IpcChannelHelper.cs
- WSDualHttpBindingElement.cs
- ToolStripPanelSelectionBehavior.cs
- BitmapEncoder.cs
- TextDocumentView.cs
- PageWrapper.cs