import {DataViewer} from './DataViewer';
//==========================================================
// 字节数组。
//
// @author maocy
// @history 150105
//==========================================================
export class Bytes extends DataViewer {
// 内存
protected _memory: ArrayBuffer;
//==========================================================
// 构造处理。
//==========================================================
public constructor(memory?: any) {
super();
if (!memory) {
memory = new (ArrayBuffer as any)();
}
this.link(memory)
}
//==========================================================
// 构造处理。
//
// @param data 数组
//==========================================================
public link(data: ArrayBuffer): void {
this._memory = data;
this._viewer = new DataView(data);
}
//==========================================================
// 释放处理。
//==========================================================
public dispose() {
this._memory = null;
this._viewer = null;
super.dispose();
}
}