# FrameReader

<div class="jsdoc-content"><header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>FrameReader<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>Buffer forward reader of CQL binary frames</p></div>
        
    
</header>


    
        

    
    </div>

## Constructor

<div class="jsdoc-content">
    

    
    <h4 class="name" id="FrameReader"><span class="type-signature"></span>new FrameReader<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Creates a new instance of the reader</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/reader.ts#L6" target="_blank" rel="noopener">reader.ts, line 6</a></p></div>




















    
    

    

    

    

    

    

    

    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h4 class="name" id="checkOffset"><span class="type-signature"></span>checkOffset<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Checks that the new length to read is within the range of the buffer length. Throws a RangeError if not.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/reader.ts#L59" target="_blank" rel="noopener">reader.ts, line 59</a></p></div>




















        
            

    

    
    <h4 class="name" id="read"><span class="type-signature"></span>read<span class="signature">(length)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Reads any number of bytes and moves the offset.
if length not provided or it's larger than the remaining bytes, reads to end.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>length</code></td>
            

            <td class="type">
            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/reader.ts#L33" target="_blank" rel="noopener">reader.ts, line 33</a></p></div>




















        
            

    

    
    <h4 class="name" id="readBytes"><span class="type-signature"></span>readBytes<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Reads the amount of bytes that the field has and returns them (slicing them).</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/reader.ts#L72" target="_blank" rel="noopener">reader.ts, line 72</a></p></div>




















        
            

    

    
    <h4 class="name" id="readInt"><span class="type-signature"></span>readInt<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Reads a BE Int and moves the offset</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/reader.ts#L49" target="_blank" rel="noopener">reader.ts, line 49</a></p></div>




















        
            

    

    
    <h4 class="name" id="slice"><span class="type-signature"></span>slice<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Slices the underlying buffer</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/reader.ts#L21" target="_blank" rel="noopener">reader.ts, line 21</a></p></div></div>
