How to convert string , date, time, byte into bitarray in C# -


i trying functions converting string bitarray, date bitarray time bitarray byte bit array. can please me these functions in c#.

for completeness, i'll include method turning arbitrary objects byte arrays (it's faster binaryformatter , memorystream):

public static byte[] tobytearray(object obj) {     int len = marshal.sizeof(obj);     byte[] arr = new byte[len];     intptr ptr = marshal.allochglobal(len);     marshal.structuretoptr(obj, ptr, true);     marshal.copy(ptr, arr, 0, len);     marshal.freehglobal(ptr);     return arr; } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -