changed calls to getBytes to specify the length (for safety)

Existing calls to getBytes are deprecated.  getBytes:length is a drop in replacement since we have the size of each buffer available.