Package ghidra.formats.gfilesystem

# Interface FileSystemService.DerivedStreamProducer

Enclosing class:
  FileSystemService

public static interface FileSystemService.DerivedStreamProducer
Used by `getDerivedByteProvider()` to produce a derivative stream from a source file.

The `InputStream` returned from the method needs to supply the bytes of the derived file and will be closed by the caller.

Example:

    fsService.getDerivedByteProvider(
         containerFSRL,
         null,
         "the_derived_file",
         -1,
         () -> new MySpecialtyInputstream(),
         monitor);

See `produceDerivedStream()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InputStream`
  `produceDerivedStream()`
  Callback method intended to be implemented by the caller to `FileSystemService.getDerivedByteProvider(FSRL, FSRL, String, long, DerivedStreamProducer, TaskMonitor)`

- ## Method Details

  - ### produceDerivedStream

    InputStream produceDerivedStream() throws IOException, CancelledException
    Callback method intended to be implemented by the caller to `FileSystemService.getDerivedByteProvider(FSRL, FSRL, String, long, DerivedStreamProducer, TaskMonitor)`

    The implementation needs to return an `InputStream` that contains the bytes of the derived file.

    Returns:
      a new `InputStream` that will produce all the bytes of the derived file
    Throws:
      `IOException` - if there is a problem while producing the InputStream
      `CancelledException` - if the user canceled