Reads capabilities from a device node.

@return A Map of capabilities for each supported axis, or null if no
capabilities are available.
@throws IOException if an error occured when reading capabilities
505310
static Map<Integer, LinuxAbsoluteInputCapabilities> getCapabilities(
            File devNode, BitSet axes) throws IOException {
        if (axes == null || axes.isEmpty()) {
            return null;
        }
        LinuxSystem system = LinuxSystem.getLinuxSystem();
        LinuxSystem.InputAbsInfo info = new LinuxSystem.InputAbsInfo();
        long fd = system.open(devNode.getPath(), LinuxSystem.O_RDONLY);
        if (fd == -1) {
            throw new IOException(system.getErrorMessage());
        }
        Map<Integer, LinuxAbsoluteInputCapabilities> caps =
                new HashMap<Integer, LinuxAbsoluteInputCapabilities>();
        for (int i = 0; (i = axes.nextSetBit(i)) != -1; i++) {
            caps.put(i, new LinuxAbsoluteInputCapabilities(system, info, fd, i));
        }
        system.close(fd);
        return caps;
    }
863321
public static int ioprioGetIfPossible() throws IOException {
    if (nativeLoaded && ioprioPossible) {
      try {
        return ioprio_get();
      } catch (UnsupportedOperationException uoe) {
        LOG.warn("ioprioGetIfPossible() failed", uoe);
        ioprioPossible = false;
      } catch (UnsatisfiedLinkError ule) {
        LOG.warn("ioprioGetIfPossible() failed", ule);
        ioprioPossible = false;
      } catch (NativeIOException nie) {
        LOG.warn("ioprioGetIfPossible() failed", nie);
        throw nie;
      }
    }
    return -1;
  }
282618
public JsonNode getApplicationsTree() throws IOException {
        Invocation invocation = getJerseyClient().target(getEndpoint() + "/v1/applications/fetch").request().buildGet();
        return invocation.invoke().readEntity(JsonNode.class);
    }
720045
public Map<K, V> getMutableMap() {
        if (mode != StorageMode.MAP) {
            if (mode == StorageMode.LIST) {
                mapData = convertListToMap(listData);
            }
            listData = null;
            mode = StorageMode.MAP;
        }
        return mapData;
    }
426389
public Properties readProperties() throws IOException {
        Properties p;

        try (Reader src = newReader()) {
            p = new Properties();
            p.load(src);
        }
        return p;
    }
771907
static Map<String, BitSet> readCapabilities(File sysPath) {
        Map<String, BitSet> capsMap = new HashMap<String, BitSet>();
        File[] capsFiles = new File(sysPath, "device/capabilities").listFiles();
        if (capsFiles == null) {
            return capsMap;
        }
        for (int i = 0; i < capsFiles.length; i++) {
            try {
                BufferedReader r = new BufferedReader(new FileReader(capsFiles[i]));
                String s = r.readLine();
                r.close();
                if (s == null) {
                    continue;
                }
                String[] elements = s.split(" ");
                if (elements == null) {
                    continue;
                }
                byte[] b = new byte[elements.length * (LinuxArch.is64Bit() ? 8 : 4)];
                ByteBuffer bb = ByteBuffer.wrap(b);
                bb.order(ByteOrder.LITTLE_ENDIAN);
                for (int j = elements.length - 1; j >= 0; j--) {
                    if (LinuxArch.is64Bit()) {
                        bb.putLong(Long.parseUnsignedLong(elements[j], 16));
                    } else {
                        bb.putInt(Integer.parseUnsignedInt(elements[j], 16));
                    }
                }
                capsMap.put(capsFiles[i].getName(), BitSet.valueOf(b));
            } catch (IOException | RuntimeException e) {
                e.printStackTrace();
            }
        }
        return capsMap;
    }
338926
protected Map<String, Object> readDocument() throws IOException {
		ObjectCodec codec = getCodec();
		if (codec == null) {
			throw new IllegalStateException("Could not parse embedded document " +
					"because BSON parser has no codec");
		}
		_currToken = handleNewDocument(false);
		return codec.readValue(this, new TypeReference<Map<String, Object>>() {});
	}
450415
@Nullable
    public Capabilities getCapabilities() {
        MutableCapabilities capabilities = (MutableCapabilities) super.getCapabilities();
        if (capabilities != null) {
            capabilities.setCapability(PLATFORM_NAME, IOS_PLATFORM);
        }
        return capabilities;
    }
1346339
protected Map<String, Object> readSimpleObject() {
		log.debug("readSimpleObject");
		Map<String, Object> result = new ObjectMap<>();
		readKeyValues(result);
		storeReference(result);
		return result;
	}
611499
public List<MapRow> readUnknownTable(int rowSize, int rowMagicNumber) throws IOException
   {
      TableReader reader = new UnknownTableReader(this, rowSize, rowMagicNumber);
      reader.read();
      return reader.getRows();
   }
538222
public int read() throws IOException {
        ensureContentAvailable();
        if (reallyAvailable()==0) {
            return -1;
        }
        int contentByte = nodeContentBytes.toByteArray()[atPos];
        atPos++;
        return contentByte;
    }
365312
@Override
    public int available()
            throws IOException
    {
        if (uncompressedCursor < uncompressedLimit) {
            return uncompressedLimit - uncompressedCursor;
        }
        else {
            if (hasNextChunk()) {
                return uncompressedLimit - uncompressedCursor;
            }
            else {
                return 0;
            }
        }
    }
709474
public java.util.Map<java.lang.String, java.lang.Long> getUsedBytesOnTiersMap() {
    return internalGetUsedBytesOnTiers().getMap();
  }
970803
public JSONObject toJson() throws IOException, JSONException {
    JSONObject json = new JSONObject();

    for (CapabilityInstance option : options.values()) {
      Object value = option.getValue();

      if (value == null) {
        continue;
      }

      if (value instanceof OperaProfile) {
        value = ((OperaProfile) value).toJson();
      } else if (value instanceof OperaArguments && ((OperaArguments) value).size() > 0) {
        value = ((OperaArguments) value).toJson();
      } else if (value instanceof Boolean) {
        value = (Boolean) value ? 1 : 0;
      } else {
        value = String.valueOf(value);
      }

      json.put(option.getIdentifier(), value);
    }

    return json;
  }
775177
public java.util.Map<java.lang.String, java.lang.Long> getTotalBytesOnTiersMap() {
    return internalGetTotalBytesOnTiers().getMap();
  }
988607
def get_capabilities(self):
        
        d = {}

        ext = self._layer.GetExtent()       # @TODO if a filter is on this may give different results
        llbb = [round(float(v), 4) for v in ext]

        d['LatLongBoundingBox'] = box(llbb[0], llbb[2], llbb[1], llbb[3])
        d['Name']               = self._file.split('/')[-1].split('.')[0]

        return d
285491
@Override
    public void read(final Reader reader) throws ConfigurationException, IOException {
        Preconditions.checkNotNull(reader);

        final HashMap<String, Object> settings = this.mapper.readValue(reader, HASH_MAP_TYPE_REFERENCE);
        final ImmutableNode rootNode = toNode(new Builder(), settings);
        this.getSubConfigurationParentModel().mergeRoot(rootNode, null, null, null, this);
    }