docs: private static void readDictionary(
              @Nullable ByteArrayInputStream dictionaryDataStream,
              int dictionarySize,
              int[] dictionaryLengthVector,
              int offsetVectorOffset,
              byte[] data,
              int[] offsetVector,
              Type type)
              throws IOException
      {
          Slice slice = wrappedBuffer(data);
  
          // initialize the offset if necessary;
          // otherwise, use the previous offset
          if (offsetVectorOffset == 0) {
              offsetVector[0] = 0;
          }
  
          // truncate string and update offsets
          for (int i = 0; i < dictionarySize; i++) {
              int offsetIndex = offsetVectorOffset + i;
              int offset = offsetVector[offsetIndex];
              int length = dictionaryLengthVector[i];
  
              int truncatedLength;
              int maxCodePointCount = getMaxCodePointCount(type);
              boolean isCharType = isCharType(type);
              if (length > 0) {
                  // read data without truncation
                  dictionaryDataStream.next(data, offset, offset + length);
  
                  // adjust offsets with truncated length
                  truncatedLength = computeTruncatedLength(slice, offset, length, maxCodePointCount, isCharType);
                  verify(truncatedLength >= 0);
              }
              else {
                  truncatedLength = 0;
              }
              offsetVector[offsetIndex + 1] = offsetVector[offsetIndex] + truncatedLength;
          }
      }