public static void padRight(BytesColumnVector outV, int i, byte[] bytes, int start, int length, int maxCharacterLength) { final int characterLength = StringExpr.characterCount(bytes, start, length); final int blankPadLength = Math.max(maxCharacterLength - characterLength, 0); final int resultLength = length + blankPadLength; outV.ensureValPreallocated(resultLength); byte[] resultBytes = outV.getValPreallocatedBytes(); final int resultStart = outV.getValPreallocatedStart(); System.arraycopy(bytes, start, resultBytes, resultStart, length); final int padEnd = resultStart + resultLength; for (int p = resultStart + length; p < padEnd; p++) { resultBytes[p] = ' '; } outV.setValPreallocated(i, resultLength); }
deserializeRead.copyToExternalBuffer( bytesColVec.getValPreallocatedBytes(), bytesColVec.getValPreallocatedStart()); bytesColVec.setValPreallocated( batchIndex, deserializeRead.currentExternalBufferNeededLen); convertBuffer, convertBufferStart); bytesColVec.setValPreallocated( batchIndex, StringExpr.truncate( convertBuffer, convertBufferStart); bytesColVec.setValPreallocated( batchIndex, StringExpr.rightTrimAndTruncate(
deserializeRead.copyToExternalBuffer( bytesColVec.getValPreallocatedBytes(), bytesColVec.getValPreallocatedStart()); bytesColVec.setValPreallocated( batchIndex, deserializeRead.currentExternalBufferNeededLen); convertBuffer, convertBufferStart); bytesColVec.setValPreallocated( batchIndex, StringExpr.truncate( convertBuffer, convertBufferStart); bytesColVec.setValPreallocated( batchIndex, StringExpr.rightTrimAndTruncate(
outputOffset += len; target.setValPreallocated(row, outputOffset - outputStart);