Skip to content

How to write a Loader that has to decode, decrypt, or decompress the data? #7186

Answered by ryanmkurtz
hippietrail asked this question in Q&A
Discussion options

You must be logged in to vote

You just use the version of MemoryBlockUtils.createInitializedBlock() that takes an InputStream rather than a FileBytes. The OmfLoader is a built-in example:

// We don't use the file bytes to create block because the bytes are manipulated before
// forming the block. Creating the FileBytes anyway in case later we want access to all
// the original bytes.
FileBytes fileBytes = MemoryBlockUtils.createFileBytes(program, provider, monitor);
try {
processSegmentHeaders(factory.getReader(), header, program, monitor, log);
processPublicSymbols(

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ryanmkurtz
Comment options

@ryanmkurtz
Comment options

@hippietrail
Comment options

@ryanmkurtz
Comment options

Answer selected by hippietrail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants