TEIID-2357 fix for setLength not consulting max buffer space