I've added some functions here that I needed. I use bytebuffer, because it's awfully convenient. I expect you don't like that. ;-) Merge at will.