Java Code Examples for com.google.api.client.util.IOUtils#serialize()

The following examples show how to use com.google.api.client.util.IOUtils#serialize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractMemoryDataStore.java    From google-http-java-client with Apache License 2.0 6 votes vote down vote up
@Override
public boolean containsValue(V value) throws IOException {
  if (value == null) {
    return false;
  }
  lock.lock();
  try {
    byte[] serialized = IOUtils.serialize(value);
    for (byte[] bytes : keyValueMap.values()) {
      if (Arrays.equals(serialized, bytes)) {
        return true;
      }
    }
    return false;
  } finally {
    lock.unlock();
  }
}
 
Example 2
Source File: CustomDataStoreFactory.java    From hop with Apache License 2.0 4 votes vote down vote up
void save() throws IOException {
  this.dataFile.createNewFile();
  IOUtils.serialize( this.keyValueMap, new FileOutputStream( this.dataFile ) );
}
 
Example 3
Source File: FileDataStoreFactory.java    From google-http-java-client with Apache License 2.0 4 votes vote down vote up
@Override
public void save() throws IOException {
  IOUtils.serialize(keyValueMap, new FileOutputStream(dataFile));
}
 
Example 4
Source File: FileDataStoreFactory.java    From google-http-java-client with Apache License 2.0 4 votes vote down vote up
@Override
public void save() throws IOException {
  IOUtils.serialize(keyValueMap, new FileOutputStream(dataFile));
}
 
Example 5
Source File: CustomDataStoreFactory.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
void save() throws IOException {
  this.dataFile.createNewFile();
  IOUtils.serialize( this.keyValueMap, new FileOutputStream( this.dataFile ) );
}