Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: static SingleByteConversion acquireSingleByteConversion(int ccsid) throws java.io.UnsupportedEncodingException
        internal static SingleByteConversion acquireSingleByteConversion(int ccsid)
        {
            // Attempt to find the shipped table using reflection
            SingleByteConversion singleByteConversion = null;
            Type conversionClass = null;

            try
            {
                conversionClass = Type.GetType("com.ibm.jtopenlite.ccsidConversion.CCSID" + ccsid);

                Type[] emptyParameterTypes          = new Type[0];
                System.Reflection.MethodInfo method = conversionClass.GetMethod("getInstance", emptyParameterTypes);
                object[] args = new object[0];
                singleByteConversion = (SingleByteConversion)method.invoke(null, args);
            }
            catch (ClassNotFoundException exceptionCause)
            {
                //
                // TODO:   Download tables from the server.
                //
                UnsupportedEncodingException ex = new UnsupportedEncodingException("CCSID=" + ccsid);
                ex.initCause(exceptionCause);
                throw ex;
            }
            catch (Exception exceptionCause)
            {
                UnsupportedEncodingException ex = new UnsupportedEncodingException("CCSID=" + ccsid);
                ex.initCause(exceptionCause);
                throw ex;
            }
            ccsidToSingleByteConversion[ccsid] = singleByteConversion;
            return(singleByteConversion);
        }
Пример #2
0
 public virtual ProcessEngineException cannotDecodePathName(UnsupportedEncodingException e)
 {
     return(new ProcessEngineException(exceptionMessage("005", "Could not decode pathname using utf-8 decoder."), e));
 }
Пример #3
0
 private static System.InvalidOperationException newIllegalStateException(string charsetName, UnsupportedEncodingException e)
 {
     return(new System.InvalidOperationException(charsetName + ": " + e));
 }