Home Manual Reference Source
public class | source

BufferBluffer

Method Summary

Public Methods
public

combine(blufferA: Buffer, blufferB: Buffer, blufferN: Array<Buffer>): Promise<Buffer>

Combines two Buffers to create a new Buffer containing the two.

public

create(text: string): Promise<Buffer>

Creates a Buffer from a binary string.

public

createBase64(base64: string): Promise<Buffer>

Creates a Buffer from a base64 encoded string.

public

read(bluffer: Buffer): Promise<string>

Extracts the contents of a Buffer as a binary string.

public

readBase64(bluffer: Buffer): Promise<string>

Extracts the contents of a Buffer as a base64 string.

public

size(bluffer: Buffer): number

Gets the length/size (in bytes) of the Buffer.

public

slice(bluffer: Buffer, start: number, end: number): Promise<Buffer>

Creates a new Buffer containing a slice of the original Buffer.

Public Methods

public combine(blufferA: Buffer, blufferB: Buffer, blufferN: Array<Buffer>): Promise<Buffer> source

Combines two Buffers to create a new Buffer containing the two.

Params:

NameTypeAttributeDescription
blufferA Buffer
blufferB Buffer
blufferN Array<Buffer>

Return:

Promise<Buffer>

public create(text: string): Promise<Buffer> source

Creates a Buffer from a binary string.

Params:

NameTypeAttributeDescription
text string

Return:

Promise<Buffer>

public createBase64(base64: string): Promise<Buffer> source

Creates a Buffer from a base64 encoded string. Effectively decoding it.

Params:

NameTypeAttributeDescription
base64 string

Return:

Promise<Buffer>

public read(bluffer: Buffer): Promise<string> source

Extracts the contents of a Buffer as a binary string.

Params:

NameTypeAttributeDescription
bluffer Buffer

Return:

Promise<string>

public readBase64(bluffer: Buffer): Promise<string> source

Extracts the contents of a Buffer as a base64 string.

Params:

NameTypeAttributeDescription
bluffer Buffer

Return:

Promise<string>

public size(bluffer: Buffer): number source

Gets the length/size (in bytes) of the Buffer.

Params:

NameTypeAttributeDescription
bluffer Buffer

Return:

number

public slice(bluffer: Buffer, start: number, end: number): Promise<Buffer> source

Creates a new Buffer containing a slice of the original Buffer.

Params:

NameTypeAttributeDescription
bluffer Buffer
start number
end number

Return:

Promise<Buffer>