コード例 #1
0
ファイル: StringUtil.cs プロジェクト: zf321/ESS.FW.Bpm
        /// <summary>
        /// converts a byte array into a string using the current process engines default charset as
        /// returned by <seealso cref="ProcessEngineConfigurationImpl#getDefaultCharset()"/>
        /// </summary>
        /// <param name="bytes"> the byte array </param>
        /// <returns> a string representing the bytes </returns>
        public static string FromBytes(byte[] bytes)
        {
            EnsureUtil.EnsureActiveCommandContext("StringUtil.fromBytes");
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;

            return(FromBytes(bytes, processEngineConfiguration.ProcessEngine));
        }
コード例 #2
0
ファイル: StringUtil.cs プロジェクト: zf321/ESS.FW.Bpm
        public static StreamWriter WriterForStream(System.IO.Stream outStream)
        {
            EnsureUtil.EnsureActiveCommandContext("StringUtil.readerFromBytes");
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;

            return(new System.IO.StreamWriter(outStream, processEngineConfiguration.DefaultCharset));
        }
コード例 #3
0
ファイル: StringUtil.cs プロジェクト: zf321/ESS.FW.Bpm
        /// <summary>
        /// Gets the bytes from a string using the current process engine's default charset
        /// </summary>
        /// <param name="string"> the string to get the bytes form </param>
        /// <returns> the byte array </returns>
        public static byte[] ToByteArray(string @string)
        {
            EnsureUtil.EnsureActiveCommandContext("StringUtil.toByteArray");
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;

            return(ToByteArray(@string, processEngineConfiguration.ProcessEngine));
        }
コード例 #4
0
ファイル: StringUtil.cs プロジェクト: zf321/ESS.FW.Bpm
        public static StreamReader ReaderFromBytes(byte[] bytes)
        {
            EnsureUtil.EnsureActiveCommandContext("StringUtil.readerFromBytes");
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;

            System.IO.MemoryStream inputStream = new System.IO.MemoryStream(bytes);

            return(new System.IO.StreamReader(inputStream, processEngineConfiguration.DefaultCharset));
        }