test_class.declarator: folder = new TemporaryFolder()
test_class.modifier: @Rule
  	public
test_class.original_string: @Rule
  	public TemporaryFolder folder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: folder
test_class.file: cache/src/test/java/net/runelite/cache/fs/flat/FlatStorageTest.java
test_class.identifier: FlatStorageTest
test_case.body: @Test
  	public void testSaveArchive() throws Exception
  	{
  		File file = folder.newFolder();
  		DiskStorage storage = new DiskStorage(file);
  		Archive archive;
  		Archive archive2;
  		try (Store store = new Store(storage))
  		{
  			Index index = store.addIndex(0);
  			archive = index.addArchive(0);
  			archive2 = index.addArchive(1);
  
  			FileData[] fileData = new FileData[1];
  			archive.setFileData(fileData);
  			fileData[0] = new FileData();
  
  			FileData[] fileData2 = new FileData[1];
  			archive2.setFileData(fileData2);
  			fileData2[0] = new FileData();
  
  			byte[] data = "test".getBytes();
  			Container container = new Container(archive.getCompression(), -1);
  			container.compress(data, null);
  			byte[] compressedData = container.data;
  			storage.saveArchive(archive, compressedData);
  
  			container = new Container(archive.getCompression(), 42);
  			container.compress(data, null);
  			compressedData = container.data;
  			archive2.setRevision(42);
  			storage.saveArchive(archive2, compressedData);
  
  			store.save();
  		}
  
  		storage = new DiskStorage(file);
  		try (Store store = new Store(storage))
  		{
  			store.load();
  			Index index = store.findIndex(0);
  			Archive archive2_1 = index.getArchive(0);
  			Archive archive2_2 = index.getArchive(1);
  
  			byte[] comprsesedData = storage.loadArchive(archive2_1);
  			byte[] data = archive2_1.decompress(comprsesedData);
  			assertArrayEquals("test".getBytes(), data);
  			assertEquals(archive.getCrc(), archive2_1.getCrc());
  			assertEquals(archive.getRevision(), archive2_1.getRevision());
  
  			comprsesedData = storage.loadArchive(archive2_2);
  			data = archive2_2.decompress(comprsesedData);
  			assertArrayEquals("test".getBytes(), data);
  			assertEquals(archive2.getCrc(), archive2_2.getCrc());
  			assertEquals(archive2.getRevision(), archive2_2.getRevision());
  		}
  	}
test_case.class_method_signature: FlatStorageTest.testSaveArchive()
test_case.full_signature: @Test public void testSaveArchive()
test_case.identifier: testSaveArchive
test_case.invocations: newFolder addIndex addArchive addArchive setFileData setFileData getBytes getCompression compress saveArchive getCompression compress setRevision saveArchive save load findIndex getArchive getArchive loadArchive decompress assertArrayEquals getBytes assertEquals getCrc getCrc assertEquals getRevision getRevision loadArchive decompress assertArrayEquals getBytes assertEquals getCrc getCrc assertEquals getRevision getRevision
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSaveArchive()
focal_class.declarator: EXTENSION = ".flatcache"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String EXTENSION = ".flatcache";
focal_class.type: String
focal_class.var_name: EXTENSION
focal_class.declarator: directory
focal_class.modifier: private final
focal_class.original_string: private final File directory;
focal_class.type: File
focal_class.var_name: directory
focal_class.declarator: data = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<Long, byte[]> data = new HashMap<>();
focal_class.type: Map<Long, byte[]>
focal_class.var_name: data
focal_class.file: cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java
focal_class.identifier: FlatStorage
focal_class.interfaces: implements Storage
focal_class.class_method_signature: FlatStorage.FlatStorage(File directory)
focal_class.full_signature: public  FlatStorage(File directory)
focal_class.identifier: FlatStorage
focal_class.modifiers: public
focal_class.parameters: (File directory)
focal_class.signature:  FlatStorage(File directory)
focal_class.class_method_signature: FlatStorage.FlatStorage()
focal_class.full_signature: protected  FlatStorage()
focal_class.identifier: FlatStorage
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  FlatStorage()
focal_class.class_method_signature: FlatStorage.openReader(String filename)
focal_class.full_signature: protected InputStream openReader(String filename)
focal_class.identifier: openReader
focal_class.modifiers: protected
focal_class.parameters: (String filename)
focal_class.return: InputStream
focal_class.signature: InputStream openReader(String filename)
focal_class.class_method_signature: FlatStorage.openWriter(String filename)
focal_class.full_signature: protected OutputStream openWriter(String filename)
focal_class.identifier: openWriter
focal_class.modifiers: protected
focal_class.parameters: (String filename)
focal_class.return: OutputStream
focal_class.signature: OutputStream openWriter(String filename)
focal_class.class_method_signature: FlatStorage.listFlatcacheFiles()
focal_class.full_signature: protected String[] listFlatcacheFiles()
focal_class.identifier: listFlatcacheFiles
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] listFlatcacheFiles()
focal_class.class_method_signature: FlatStorage.init(Store store)
focal_class.full_signature: @Override public void init(Store store)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (Store store)
focal_class.return: void
focal_class.signature: void init(Store store)
focal_class.class_method_signature: FlatStorage.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: FlatStorage.load(Store store)
focal_class.full_signature: @Override public void load(Store store)
focal_class.identifier: load
focal_class.modifiers: @Override public
focal_class.parameters: (Store store)
focal_class.return: void
focal_class.signature: void load(Store store)
focal_class.class_method_signature: FlatStorage.save(Store store)
focal_class.full_signature: @Override public void save(Store store)
focal_class.identifier: save
focal_class.modifiers: @Override public
focal_class.parameters: (Store store)
focal_class.return: void
focal_class.signature: void save(Store store)
focal_class.class_method_signature: FlatStorage.loadArchive(Archive archive)
focal_class.full_signature: @Override public byte[] loadArchive(Archive archive)
focal_class.identifier: loadArchive
focal_class.modifiers: @Override public
focal_class.parameters: (Archive archive)
focal_class.return: byte[]
focal_class.signature: byte[] loadArchive(Archive archive)
focal_class.class_method_signature: FlatStorage.saveArchive(Archive archive, byte[] bytes)
focal_class.full_signature: @Override public void saveArchive(Archive archive, byte[] bytes)
focal_class.identifier: saveArchive
focal_class.modifiers: @Override public
focal_class.parameters: (Archive archive, byte[] bytes)
focal_class.return: void
focal_class.signature: void saveArchive(Archive archive, byte[] bytes)
focal_method.body: @Override
  	public void saveArchive(Archive archive, byte[] bytes) throws IOException
  	{
  		data.put((long) archive.getIndex().getId() << 32 | archive.getArchiveId(), bytes);
  	}
focal_method.class_method_signature: FlatStorage.saveArchive(Archive archive, byte[] bytes)
focal_method.full_signature: @Override public void saveArchive(Archive archive, byte[] bytes)
focal_method.identifier: saveArchive
focal_method.invocations: put getId getIndex getArchiveId
focal_method.modifiers: @Override public
focal_method.parameters: (Archive archive, byte[] bytes)
focal_method.return: void
focal_method.signature: void saveArchive(Archive archive, byte[] bytes)