[bytebuffer] Add missing 'readBytes' and 'writeBytes' functions (#23044)

This commit is contained in:
Edward Woolhouse
2018-01-23 18:47:15 +00:00
committed by Andy
parent cc49e97d50
commit f009df31d0

View File

@@ -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.
*/