docs: private String readAttributeAsJson(Attribute attribute) throws UnsupportedKerasConfigurationException {
          synchronized (Hdf5Archive.LOCK_OBJECT) {
              VarLenType vl = attribute.getVarLenType();
              int bufferSizeMult = 1;
              String s;
              /* TODO: find a less hacky way to do this.
               * Reading variable length strings (from attributes) is a giant
               * pain. There does not appear to be any way to determine the
               * length of the string in advance, so we use a hack: choose a
               * buffer size and read the config. If Jackson fails to parse
               * it, then we must not have read the entire config. Increase
               * buffer and repeat.
               */
              while (true) {
                  byte[] attrBuffer = new byte[bufferSizeMult * 2000];
                  BytePointer attrPointer = new BytePointer(attrBuffer);
                  attribute.read(vl, attrPointer);
                  attrPointer.get(attrBuffer);
                  s = new String(attrBuffer);
                  ObjectMapper mapper = new ObjectMapper();
                  mapper.enable(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY);
                  try {
                      mapper.readTree(s);
                      break;
                  } catch (IOException e) {
                      //OK - we don't know how long the buffer needs to be, so we'll try again with larger buffer
                  }
                  bufferSizeMult *= 2;
                  if (bufferSizeMult > 1024) {
                      throw new UnsupportedKerasConfigurationException("Could not read abnormally long HDF5 attribute");
                  }
              }
              vl.deallocate();
              return s;
          }
      }