Pure C ByteBuffer implementation