/// <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 sbyte[] toByteArray(string @string) { EnsureUtil.ensureActiveCommandContext("StringUtil.toByteArray"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration; return(toByteArray(@string, processEngineConfiguration.ProcessEngine)); }
public static Writer writerForStream(Stream outStream) { EnsureUtil.ensureActiveCommandContext("StringUtil.readerFromBytes"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration; return(new StreamWriter(outStream, processEngineConfiguration.DefaultCharset)); }
/// <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(sbyte[] bytes) { EnsureUtil.ensureActiveCommandContext("StringUtil.fromBytes"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration; return(fromBytes(bytes, processEngineConfiguration.ProcessEngine)); }
public static Reader readerFromBytes(sbyte[] bytes) { EnsureUtil.ensureActiveCommandContext("StringUtil.readerFromBytes"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration; MemoryStream inputStream = new MemoryStream(bytes); return(new StreamReader(inputStream, processEngineConfiguration.DefaultCharset)); }