Package picard.util

## Class FifoBuffer

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.util.FifoBuffer

-     @DocumentedFeature
      public class FifoBuffer
      extends CommandLineProgram

  ### Summary

  Acts as a large memory buffer between processes that are connected with unix pipes for the case that one or more processes produces or consumes their input or output in bursts. By inserting a large memory buffer between such processes each process can run at full speed and the bursts can be smoothed out by the memory buffer.

  ### Example

         java -jar SamToFastq.jar \
            F=my.fastq \
            INTERLEAVE=true |
         java -jar FifoBuffer |
         bwa mem -t 8 -Y reference.fasta \dev\stdin output.bam

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `BUFFER_SIZE` |
    `int` | `DEBUG_FREQUENCY` |
    `int` | `IO_SIZE` |
    `String` | `NAME` |

    - ### Fields inherited from class picard.cmdline.CommandLineProgram

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FifoBuffer()` | Constructor that defaults to QUIET since Fifos don't do anything beyond buffering having their start/end information logged is often undesirable.
    `FifoBuffer​(InputStream in, PrintStream out)` | Constructor that defaults to QUIET since Fifos don't do anything beyond buffering having their start/end information logged is often undesirable.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected int` | `doWork()` | Do the work after command line has been parsed.

    - ### Methods inherited from class picard.cmdline.CommandLineProgram

      `checkRInstallation, customCommandLineValidation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### BUFFER_SIZE

          @Argument(doc="The size of the memory buffer in bytes.")
          public int BUFFER_SIZE

    - #### IO_SIZE

          @Argument(doc="The size, in bytes, to read/write atomically to the input and output streams.")
          public int IO_SIZE

    - #### DEBUG_FREQUENCY

          @Argument(doc="How frequently, in seconds, to report debugging statistics. Set to zero for never.")
          public int DEBUG_FREQUENCY

    - #### NAME

          @Argument(doc="Name to use for Fifo in debugging statements.",
                    optional=true)
          public String NAME

  - ### Constructor Detail

    - #### FifoBuffer

          public FifoBuffer​(InputStream in,
                            PrintStream out)

      Constructor that defaults to QUIET since Fifos don't do anything beyond buffering having their start/end information logged is often undesirable.

    - #### FifoBuffer

          public FifoBuffer()

      Constructor that defaults to QUIET since Fifos don't do anything beyond buffering having their start/end information logged is often undesirable.

  - ### Method Detail

    - #### doWork

          protected int doWork()

      Description copied from class: `CommandLineProgram`
      Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.
      Specified by:
        `doWork` in class `CommandLineProgram`
      Returns:
        program exit status.