Was this page helpful?
Caution
You're viewing documentation for an unstable version of ScyllaDB Node.js Driver. Switch to the latest stable version.
FrameReader¶
FrameReader(body)
Buffer forward reader of CQL binary frames
Constructor¶
new FrameReader(body)
Creates a new instance of the reader
Parameters:
| Name | Type | Description |
|---|---|---|
body |
Buffer |
Source
Methods¶
checkOffset(newLength)
Checks that the new length to read is within the range of the buffer length. Throws a RangeError if not.
Parameters:
| Name | Type | Description |
|---|---|---|
newLength |
Number |
Source
read(length) → {Buffer}
Reads any number of bytes and moves the offset. if length not provided or it's larger than the remaining bytes, reads to end.
Parameters:
| Name | Type | Description |
|---|---|---|
length |
Source
Returns:
- Type
- Buffer
readBytes() → {Buffer}
Reads the amount of bytes that the field has and returns them (slicing them).
Source
Returns:
- Type
- Buffer
readInt() → {Number}
Reads a BE Int and moves the offset
Source
Returns:
- Type
- Number
slice(begin, endopt) → {Buffer}
Slices the underlying buffer
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
begin |
Number | ||
end |
Number |
<optional> |
Source
Returns:
- Type
- Buffer