private byte[] negotiate(ExtendedNegotiation exneg, TransferCapability tc) { if (exneg == null) return null; StorageOptions storageOptions = tc.getStorageOptions(); if (storageOptions != null) return storageOptions.toExtendedNegotiationInformation(); EnumSet<QueryOption> queryOptions = tc.getQueryOptions(); if (queryOptions != null) { EnumSet<QueryOption> commonOpts = QueryOption.toOptions(exneg); commonOpts.retainAll(queryOptions); return QueryOption.toExtendedNegotiationInformation(commonOpts); } return null; }