Optimize the getObjectLength and getObjectValue for varchar and varbinary