# Class: com.pnfsoftware.jeb.util.io.RotatingFileOutputStream

Output stream whose sinks are a series of files. When the output exceeds the maximum file count and maximum size per file, it gets rotated: older output gets deleted to make room for more recent output.

## Constructor: RotatingFileOutputStream
- parameter: `folder`, type: `java.io.File`
- parameter: `basename`, type: `java.lang.String`
- parameter: `rotFileCount`, type: `int`
- parameter: `rotFileSize`, type: `long`

Description: Create a rotating file\(s\) output stream. The stream is buffered, output is appended to existing files \(if any\).
parameter: folder: 
parameter: basename: 
parameter: rotFileCount: 
parameter: rotFileSize: 
throws: 

## Constructor: RotatingFileOutputStream
- parameter: `folder`, type: `java.io.File`
- parameter: `basename`, type: `java.lang.String`
- parameter: `rotFileCount`, type: `int`
- parameter: `rotFileSize`, type: `long`
- parameter: `buffered`, type: `boolean`
- parameter: `appendToExisting`, type: `boolean`

Description: Create a rotating file\(s\) output stream.
parameter: folder: output folder; use null to denote the current working directory
parameter: basename: base file name, must be non\-empty
parameter: rotFileCount: \>=0 \(can be 0 for no rotating output\); should be \>= 1
parameter: rotFileSize: \>0 \(cannot be negative or "infinite": a maximum file size must be            specified to prevent uncontrolled growth\)
parameter: buffered: enable or disable buffered\-writes \(recommended for high\-frequency writing\)
parameter: appendToExisting: append to a previously existing file, if any
throws: on IO error

## Method: close


## Method: flush


## Protected Method: generateFileSuffix
- parameter: `fileIndex`, type: `int`
- return type: `java.lang.String`

Description: The file suffix appended to the base filename for additional file. Note that the default implementation simply generates a ".N" suffix.
parameter: fileIndex: file index
return: 

## Method: getAdditionalOutputFile
- parameter: `i`, type: `int`
- return type: `java.io.File`

Description: Retrieve an additional output file by index.
parameter: i: file index, must be in \[1, maximum\_filecount\]
return: 
throws: 

## Method: getOutputFile
- return type: `java.io.File`

Description: Retrieve the principal \(first\) output file.
return: 

## Method: getRotatingFileCount
- return type: `int`


## Method: getRotatingFileSize
- return type: `long`


## Method: getRotationCount
- return type: `long`


## Method: isBuffered
- return type: `boolean`


## Method: rotate


## Method: write
- parameter: `b`, type: `int`


## Method: write
- parameter: `b`, type: `byte[]`
- parameter: `off`, type: `int`
- parameter: `len`, type: `int`


