-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rebuild support for VersionInfo related structures
- Loading branch information
Showing
13 changed files
with
502 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/kichik/pecoff4j/RebuildableStructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.kichik.pecoff4j; | ||
|
||
import com.kichik.pecoff4j.io.IDataWriter; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* A structure that contains values derived from its content like lengths, checksums or pointers to nested structures. | ||
* | ||
* Use {@link #rebuild()} to update these values prior to {@link #write(IDataWriter)}. The latter just stores the values | ||
* as they are present. | ||
*/ | ||
public interface RebuildableStructure { | ||
/** | ||
* Update derived values such as lengths, checksums, serialized layout etc. | ||
* | ||
* @return the updated length of this structure in bytes (might include padding) | ||
*/ | ||
int rebuild(); | ||
|
||
/** | ||
* Write this structure to a data writer. | ||
* | ||
* @param dw the writer | ||
*/ | ||
void write(IDataWriter dw) throws IOException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.