Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1x 1x 1x 2x 2x 2x 2x | import { BufferReader } from '@node-dlc/bufio';
import { AddressIPv6 } from '../../domain/AddressIPv6';
import { ipv6StringFromBuffer } from './ipv6StringFromBuffer';
/**
* Deserializes an IPv6 address from a reader and
* returns an instance of an IPv6 Address.
*/
export function deserializeIPv6(reader: BufferReader): AddressIPv6 {
const hostBytes = reader.readBytes(16);
const port = reader.readUInt16BE();
const host = ipv6StringFromBuffer(hostBytes);
return new AddressIPv6(host, port);
}
|