aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/ExtensionsMethods.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-10 06:03:25 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-10 06:03:25 +0100
commit523a04de5252ae089e52eeaf9c8d83a5e0676731 (patch)
tree4498dc0edfa1e5b101807bdc85061884bda3dac2 /src/ExtensionsMethods.cs
parent991a840bf9bc92ddc76e9e9961706168328a211b (diff)
getStremFromPath made instanced for overriding in designiface, crowide wip
Diffstat (limited to 'src/ExtensionsMethods.cs')
-rw-r--r--src/ExtensionsMethods.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ExtensionsMethods.cs b/src/ExtensionsMethods.cs
index d7448874..cb662c51 100644
--- a/src/ExtensionsMethods.cs
+++ b/src/ExtensionsMethods.cs
@@ -144,7 +144,12 @@ namespace Crow
handler(sender, e);
}
}
-
+ public static byte[] GetBytes(this string str)
+ {
+ byte[] bytes = new byte[str.Length * sizeof(char)];
+ System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
+ return bytes;
+ }
public static bool IsWhiteSpaceOrNewLine (this char c)
{
return c == '\t' || c == '\r' || c == '\n' || char.IsWhiteSpace (c);