Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- followingquery.cs
- TemplateInstanceAttribute.cs
- HtmlElement.cs
- DeflateStreamAsyncResult.cs
- TextChange.cs
- ExpressionLink.cs
- QueryContinueDragEvent.cs
- Type.cs
- _NTAuthentication.cs
- SendMailErrorEventArgs.cs
- RawContentTypeMapper.cs
- ResourceReferenceExpressionConverter.cs
- XmlSchemaComplexContent.cs
- TableRow.cs
- SiteMapDataSource.cs
- SafeRightsManagementEnvironmentHandle.cs
- AmbientLight.cs
- SequentialWorkflowHeaderFooter.cs
- RemotingException.cs
- File.cs
- IgnoreSectionHandler.cs
- VoiceSynthesis.cs
- _ProxyChain.cs
- DataPagerFieldCollection.cs
- VisualTreeUtils.cs
- HuffModule.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- _ProxyChain.cs
- BaseConfigurationRecord.cs
- PersonalizationStateQuery.cs
- SessionPageStatePersister.cs
- ValueSerializer.cs
- Stopwatch.cs
- Propagator.Evaluator.cs
- DrawingCollection.cs
- BlobPersonalizationState.cs
- SchemaReference.cs
- PagedDataSource.cs
- HtmlHead.cs
- ModelPropertyImpl.cs
- NetCodeGroup.cs
- TableCellCollection.cs
- XmlSchemaInfo.cs
- BoundField.cs
- XmlReflectionMember.cs
- MissingFieldException.cs
- OutputCacheSection.cs
- Floater.cs
- PixelShader.cs
- ObfuscationAttribute.cs
- ToolStripDropTargetManager.cs
- ButtonChrome.cs
- LocalServiceSecuritySettingsElement.cs
- StickyNoteContentControl.cs
- TypeResolver.cs
- MappingSource.cs
- BindingsCollection.cs
- RemoteWebConfigurationHost.cs
- Inflater.cs
- FaultImportOptions.cs
- Invariant.cs
- XmlConvert.cs
- SoapAttributeOverrides.cs
- SemanticBasicElement.cs
- HeaderPanel.cs
- TabletDeviceInfo.cs
- XsltSettings.cs
- TableLayoutSettingsTypeConverter.cs
- M3DUtil.cs
- DefaultPropertiesToSend.cs
- SecureEnvironment.cs
- DeviceSpecificDesigner.cs
- latinshape.cs
- EntitySqlException.cs
- FileUpload.cs
- IODescriptionAttribute.cs
- CodeExporter.cs
- CollectionEditor.cs
- FontNameEditor.cs
- ThemeDictionaryExtension.cs
- HwndMouseInputProvider.cs
- TriState.cs
- SqlDataSourceParameterParser.cs
- ACL.cs
- DataGridLength.cs
- DocumentViewerBaseAutomationPeer.cs
- KeyProperty.cs
- TypeHelpers.cs
- UriTemplateTable.cs
- CodeMethodReturnStatement.cs
- PostBackOptions.cs
- SafeViewOfFileHandle.cs
- SecurityVersion.cs
- GridToolTip.cs
- Image.cs
- PropertyGridView.cs
- WindowsListViewGroup.cs
- ProxyWebPart.cs
- ServiceHttpModule.cs
- DescriptionAttribute.cs