PersistentFileTracker persistentFileTracker, MasterSecret masterKey)
throws IOException, StorageFormatException, ResumeFailedException {
int magic = dis.readInt();
switch(magic) {
case AEADCryptBucket.MAGIC:
return new AEADCryptBucket(dis, fg, persistentFileTracker, masterKey);
case FileBucket.MAGIC:
return new FileBucket(dis);
case PersistentTempFileBucket.MAGIC:
return new PersistentTempFileBucket(dis);
case DelayedFreeBucket.MAGIC: