updates to include direct byte buffers per andre silvas suggestion