Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- UInt64.cs
- Int32CollectionValueSerializer.cs
- MultiView.cs
- RegistryHandle.cs
- Lasso.cs
- HwndKeyboardInputProvider.cs
- SHA512Managed.cs
- RIPEMD160.cs
- ChangeBlockUndoRecord.cs
- APCustomTypeDescriptor.cs
- OperatingSystem.cs
- SimpleHandlerFactory.cs
- InstanceContextMode.cs
- Gdiplus.cs
- UnsafeNativeMethods.cs
- NumberFunctions.cs
- TypeReference.cs
- NativeMethods.cs
- ISAPIWorkerRequest.cs
- ToolboxItemSnapLineBehavior.cs
- TabControlEvent.cs
- BackEase.cs
- AutomationPattern.cs
- ProcessManager.cs
- ControlUtil.cs
- DesignerWebPartChrome.cs
- HwndAppCommandInputProvider.cs
- DbParameterCollectionHelper.cs
- LexicalChunk.cs
- safex509handles.cs
- TextElementEditingBehaviorAttribute.cs
- SQLInt16.cs
- CodeDirectoryCompiler.cs
- UrlPath.cs
- AddInIpcChannel.cs
- MonthCalendarDesigner.cs
- AsymmetricAlgorithm.cs
- MimeMapping.cs
- LabelLiteral.cs
- SplineKeyFrames.cs
- ListChangedEventArgs.cs
- XmlNodeChangedEventArgs.cs
- ListViewItemMouseHoverEvent.cs
- GeneralTransform.cs
- MetadataPropertyCollection.cs
- Trustee.cs
- WinEventQueueItem.cs
- ProfessionalColors.cs
- SqlBooleanizer.cs
- ExpressionVisitor.cs
- RotateTransform3D.cs
- DrawListViewItemEventArgs.cs
- NamespaceExpr.cs
- MailMessageEventArgs.cs
- DrawingGroup.cs
- Debug.cs
- DispatcherObject.cs
- ComplexPropertyEntry.cs
- ScriptReferenceBase.cs
- BitStream.cs
- SkewTransform.cs
- ImageCodecInfo.cs
- BitmapDecoder.cs
- NamedElement.cs
- CodeCommentStatement.cs
- KeyPullup.cs
- ModelTreeEnumerator.cs
- Function.cs
- DisposableCollectionWrapper.cs
- AuthorizationRuleCollection.cs
- WebHeaderCollection.cs
- AbandonedMutexException.cs
- HttpStreamXmlDictionaryWriter.cs
- RijndaelManagedTransform.cs
- DbProviderFactory.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SafeNativeMethods.cs
- BaseCodeDomTreeGenerator.cs
- WebPartConnectionCollection.cs
- Int32.cs
- HttpHandlerAction.cs
- SapiAttributeParser.cs
- TraceHandler.cs
- DigitShape.cs
- WSSecurityPolicy12.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- ObjectStorage.cs
- recordstatescratchpad.cs
- AssemblyName.cs
- HtmlControl.cs
- ContainerUtilities.cs
- StatusCommandUI.cs
- Trace.cs
- UnsafeNativeMethods.cs
- ReadOnlyDataSource.cs
- ModuleBuilder.cs
- CommentAction.cs
- SqlPersistenceProviderFactory.cs
- RefreshEventArgs.cs
- View.cs