Skip to content

Commit

Permalink
Update Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSwigerAtBentley committed Jan 16, 2025
1 parent 83817a8 commit 3afecb5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/bentley/src/ByteStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export class ByteStream {
* ArrayBuffer. If `bytes` represents only a **sub-range** of the underlying buffer's data, the results will be unexpected unless the optional `subView`
* argument is supplied, with correct offset and length.
*
* For both of the above reasons, prefer to use [[fromUint8Array]].
* @deprecated in 3.x. Use [[fromUint8Array]] or [[fromArrayBuffer]].
* For both of the above reasons, this constructor is private, and [[fromUint8Array]] or [[fromArrayBuffer]] should be used to create a ByteStream.
*/
private constructor(buffer: ArrayBuffer | SharedArrayBuffer, subView?: { byteOffset: number, byteLength: number }) {
if (undefined !== subView) {
Expand All @@ -51,15 +50,15 @@ export class ByteStream {
*/
public static fromUint8Array(bytes: Uint8Array): ByteStream {
const { byteOffset, byteLength } = bytes;
return new ByteStream(bytes.buffer, { byteOffset, byteLength }); // eslint-disable-line @typescript-eslint/no-deprecated
return new ByteStream(bytes.buffer, { byteOffset, byteLength });
}

/** Construct a new ByteStream with the read position set to the beginning.
* @param buffer The underlying buffer from which data is to be extracted.
* @param subView If defined, specifies the subset of the underlying buffer's data to use.
*/
public static fromArrayBuffer(buffer: ArrayBuffer | SharedArrayBuffer, subView?: { byteOffset: number, byteLength: number }): ByteStream {
return new ByteStream(buffer, subView); // eslint-disable-line @typescript-eslint/no-deprecated
return new ByteStream(buffer, subView);
}

/** The number of bytes in this stream */
Expand Down

0 comments on commit 3afecb5

Please sign in to comment.