nl_tokens: Converts the request object into a readable stream that can be read from or piped into a writable stream .
pl_tokens: function createReadStream ( ) { var streams = AWS . util . nodeRequire ( 'stream' ) ; var req = this ; var stream = null ; var legacyStreams = false ; if ( AWS . HttpClient . streamsApiVersion === 2 ) { stream = new streams . Readable ( ) ; stream . _read = function ( ) { } ; } else { stream = new streams . Stream ( ) ; stream . readable = true ; } stream . sent = false ; stream . on ( 'newListener' , function ( event ) { if ( ! stream . sent && ( event === 'data' || event === 'readable' ) ) { if ( event === 'data' ) legacyStreams = true ; stream . sent = true ; process . nextTick ( function ( ) { req . send ( function ( ) { } ) ; } ) ; } } ) ; this . on ( 'httpHeaders' , function streamHeaders ( statusCode , headers , resp ) { if ( statusCode < 300 ) { this . httpRequest . _streaming = true ; req . removeListener ( 'httpData' , AWS . EventListeners . Core . HTTP_DATA ) ; req . removeListener ( 'httpError' , AWS . EventListeners . Core . HTTP_ERROR ) ; req . on ( 'httpError' , function streamHttpError ( error , resp ) { resp . error = error ; resp . error . retryable = false ; } ) ; var httpStream = resp . httpResponse . stream ; if ( legacyStreams ) { httpStream . on ( 'data' , function ( arg ) { stream . emit ( 'data' , arg ) ; } ) ; httpStream . on ( 'end' , function ( ) { stream . emit ( 'end' ) ; } ) ; } else { httpStream . on ( 'readable' , function ( ) { var chunk ; <mask> { chunk = httpStream . read ( ) ; if ( chunk !== null ) stream . push ( chunk ) ; } while ( chunk !== null ) ; stream . read ( 0 ) ; } ) ; httpStream . on ( 'end' , function ( ) { stream . push ( null ) ; } ) ; } httpStream . on ( 'error' , function ( err ) { stream . emit ( 'error' , err ) ; } ) ; } } ) ; this . on ( 'error' , function ( err ) { stream . emit ( 'error' , err ) ; } ) ; return stream ; }