+ @NonNull
+ private List<Definition> read(@NonNull BitBuffer input, IDefinitionScope definitionScope, String fieldName) throws CTFReaderException {
+ Builder<Definition> definitions = new ImmutableList.Builder<>();
+ if (!fChildrenNames.containsKey(fieldName)) {
+ for (int i = 0; i < fLength; i++) {
+ fChildrenNames.put(fieldName, fieldName + '[' + i + ']');
+ }
+ }
+ List<String> elemNames = (List<String>) fChildrenNames.get(fieldName);
+ for (int i = 0; i < fLength; i++) {
+ String name = elemNames.get(i);
+ if (name == null) {
+ throw new IllegalStateException();
+ }
+ definitions.add(fElemType.createDefinition(definitionScope, name, input));
+ }
+ @SuppressWarnings("null")
+ @NonNull ImmutableList<Definition> ret = definitions.build();
+ return ret;
+ }
+
+ /**
+ * @since 3.0
+ */
+ @Override
+ public int getMaximumSize() {
+ long val = (long) fLength * fElemType.getMaximumSize();
+ return (int) Math.min(Integer.MAX_VALUE, val);
+ }
+