From f009df31d0b1a604f4ebdda34e7f3bcf4f327791 Mon Sep 17 00:00:00 2001 From: Edward Woolhouse Date: Tue, 23 Jan 2018 18:47:15 +0000 Subject: [PATCH] [bytebuffer] Add missing 'readBytes' and 'writeBytes' functions (#23044) --- types/bytebuffer/index.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/bytebuffer/index.d.ts b/types/bytebuffer/index.d.ts index fca26b439f..0ed98f54c6 100644 --- a/types/bytebuffer/index.d.ts +++ b/types/bytebuffer/index.d.ts @@ -307,6 +307,11 @@ declare class ByteBuffer */ readByte( offset?: number ): number; + /** + * Reads the specified number of bytes + */ + readBytes( length: number, offset?: number): ByteBuffer; + /** * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters itself. */ @@ -508,6 +513,11 @@ declare class ByteBuffer */ writeByte( value: number, offset?: number ): ByteBuffer; + /** + * Writes an array of bytes. This is an alias for append + */ + writeBytes( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + /** * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself. */