need to check bytes.length is large enough.