/// <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)); }
public static StreamWriter WriterForStream(System.IO.Stream outStream) { EnsureUtil.EnsureActiveCommandContext("StringUtil.readerFromBytes"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration; return(new System.IO.StreamWriter(outStream, processEngineConfiguration.DefaultCharset)); }
/// <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)); }
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)); }