function ConstantStream( value, options ) {
	var opts;
	var err;
	if ( !( this instanceof ConstantStream ) ) {
		if ( arguments.length > 1 ) {
			return new ConstantStream( value, options );
		}
		return new ConstantStream( value );
	}
	opts = assign( {}, DEFAULTS );
	if ( arguments.length > 1 ) {
		err = validate( opts, options );
		if ( err ) {
			throw err;
		}
	}
	if ( opts.objectMode === false ) {
		if ( isString( value ) ) {
			value = string2buffer( value );
		} else if ( isBuffer( value ) ) { // NOTE: order matters here. We want the `isBuffer` check BEFORE the `isUint8Array` check!!
			// Nothing to do, as value is already a buffer...
		} else if ( isUint8Array( value ) ) {
			// Convert to a `Buffer` object to provide backward compatibility with older Node.js versions...
			value = arraybuffer2buffer( value.buffer, value.byteOffset, value.length ); // eslint-disable-line max-len
		} else {
			throw new TypeError( format( 'invalid argument. In binary mode, a provided value must be a string, Buffer, or Uint8Array. Value: `%s`.', value ) );
		}
	}
	// Make the stream a readable stream:
	debug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );
	Readable.call( this, opts );

	// Destruction state:
	setNonEnumerable( this, '_destroyed', false );

	// Cache whether the stream is operating in object mode:
	setNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );

	// Cache the separator:
	setNonEnumerableReadOnly( this, '_sep', string2buffer( opts.sep ) );

	// Cache the total number of iterations:
	setNonEnumerableReadOnly( this, '_iter', opts.iter );

	// Cache the value to stream:
	setNonEnumerableReadOnly( this, '_value', value );

	// Initialize an iteration counter:
	setNonEnumerable( this, '_i', 0 );

	return this;
}
Stream constructor for generating a stream which always streams the same value.

@constructor
@param {(string|Buffer|Uint8Array)} value - value to stream
@param {Options} [options] - stream options
@param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode
@param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings
@param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before pausing streaming
@param {string} [options.sep='\n'] - separator used to join streamed data
@param {NonNegativeInteger} [options.iter] - number of iterations
@throws {TypeError} in binary mode, value to stream must be a string, `Buffer`, or `Uint8Array`
@throws {TypeError} options argument must be an object
@throws {TypeError} must provide valid options
@returns {ConstantStream} Stream instance

@example
var inspectStream = require( '@stdlib/streams/node/inspect-sink' );

function log( chunk ) {
   console.log( chunk.toString() );
}

var opts = {
    'iter': 10
};

var stream = new ConstantStream( 'beep', opts );

stream.pipe( inspectStream( log )  );