node: Add methods Buffer.compare(), NodeBuffer.equals() and NodeBuffer.compare().

This commit is contained in:
itokentr committed 2015-06-23 19:42:58 +09:00
1 parent 3e117d8c9d
commit 979de8c421
1 file changed
+6
+6
View File
@@ -127,6 +127,10 @@ declare var Buffer: {
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
*/
concat(list: Buffer[], totalLength?: number): Buffer;
/**
* The same as buf1.compare(buf2).
*/
compare(buf1: Buffer, buf2: Buffer): number;
};
/************************************************
@@ -327,6 +331,8 @@ interface NodeBuffer {
toString(encoding?: string, start?: number, end?: number): string;
toJSON(): any;
length: number;
equals(otherBuffer: Buffer): boolean;
compare(otherBuffer: Buffer): number;
copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
slice(start?: number, end?: number): Buffer;
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;