VolumeDriver

VolumeDriver

new VolumeDriver(_path, opts) → {void}

Description:
  • Abstract constructor for the class. Should not be called directly.

Source:
Parameters:
Name Type Description
_path _path

The path to the file.

opts Object

Optional parameters.

Properties
Name Type Description
readOnly boolean

Whether the file is read-only.

Returns:
Type
void

Members

numSectors

Description:
  • Abstract method for getting the number of sectors. Should not be called directly.

Source:

Abstract method for getting the number of sectors. Should not be called directly.

numSectors

Description:
  • Abstract method for getting the number of sectors. Should not be called directly.

Source:

Abstract method for getting the number of sectors. Should not be called directly.

partitionNumber

Description:
  • Get the value of the partitionNumber property.

Source:

Get the value of the partitionNumber property.

partitionNumber

Description:
  • Set the partition number and calculate the partition offset in bytes.

Source:

Set the partition number and calculate the partition offset in bytes.

partitionNumber

Description:
  • Get the value of the partitionNumber property.

Source:

Get the value of the partitionNumber property.

partitionNumber

Description:
  • Set the partition number and calculate the partition offset in bytes.

Source:

Set the partition number and calculate the partition offset in bytes.

partitionOffsetBytes

Description:
  • Returns the offset bytes for the currently selected partition

Source:

Returns the offset bytes for the currently selected partition

partitionOffsetBytes

Description:
  • Returns the offset bytes for the currently selected partition

Source:

Returns the offset bytes for the currently selected partition

readOnly

Description:
  • Get the value of the readOnly property.

Source:

Get the value of the readOnly property.

readOnly

Description:
  • Get the value of the readOnly property.

Source:

Get the value of the readOnly property.

sectorSize

Description:
  • Get the sector size.

Source:

Get the sector size.

sectorSize

Description:
  • Get the sector size.

Source:

Get the sector size.

Methods

checkSectorLength(dest)

Description:
  • Checks if the length of a destination buffer is a multiple of the sector size.

Source:
Parameters:
Name Type Description
dest any

The destination buffer to check.

Throws:

Throws an error if the buffer length is not a multiple of the sector size.

Type
Error

checkSectorLength(dest)

Description:
  • Checks if the length of a destination buffer is a multiple of the sector size.

Source:
Parameters:
Name Type Description
dest any

The destination buffer to check.

Throws:

Throws an error if the buffer length is not a multiple of the sector size.

Type
Error

parsePartitionsFromBuffer(buffer) → {Array}

Description:
  • Parses partitions from a buffer. Reads a FAT16 MBR and returns an array of partition offsets.

Source:
Parameters:
Name Type Description
buffer Buffer

The buffer to parse partitions from.

Returns:

An array of partition offsets.

Type
Array

parsePartitionsFromBuffer(buffer) → {Array}

Description:
  • Parses partitions from a buffer. Reads a FAT16 MBR and returns an array of partition offsets.

Source:
Parameters:
Name Type Description
buffer Buffer

The buffer to parse partitions from.

Returns:

An array of partition offsets.

Type
Array

readPartitions()

Description:
  • Abstract method for reading partitions. Should not be called directly.

Source:
Throws:

Abstract method 'readPartitions' must be implemented

Type
Error

readPartitions()

Description:
  • Abstract method for reading partitions. Should not be called directly.

Source:
Throws:

Abstract method 'readPartitions' must be implemented

Type
Error

readSectors(i, dest, cb) → {undefined}

Description:
  • Abstract method for reading sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to read.

dest ArrayBuffer

The destination array to copy the sector data to.

cb function

The callback function to be called when the sector data has been copied.

Returns:

This function does not return a value.

Type
undefined

readSectors(i, dest, cb) → {undefined}

Description:
  • Abstract method for reading sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to read.

dest ArrayBuffer

The destination array to copy the sector data to.

cb function

The callback function to be called when the sector data has been copied.

Returns:

This function does not return a value.

Type
undefined

writeSectors(i, data, cb)

Description:
  • Abstract method for writing sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to write to.

data Buffer

The data to write to the sector.

cb function

The callback function to be called when the write operation is complete.

Throws:

Cannot write to read-only volume!

Type
Error

writeSectors(i, data, cb)

Description:
  • Abstract method for writing sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to write to.

data Buffer

The data to write to the sector.

cb function

The callback function to be called when the write operation is complete.

Throws:

Cannot write to read-only volume!

Type
Error

VolumeDriver

new VolumeDriver(_path, opts) → {void}

Description:
  • Abstract constructor for the class. Should not be called directly.

Source:
Parameters:
Name Type Description
_path _path

The path to the file.

opts Object

Optional parameters.

Properties
Name Type Description
readOnly boolean

Whether the file is read-only.

Returns:
Type
void

Members

numSectors

Description:
  • Abstract method for getting the number of sectors. Should not be called directly.

Source:

Abstract method for getting the number of sectors. Should not be called directly.

numSectors

Description:
  • Abstract method for getting the number of sectors. Should not be called directly.

Source:

Abstract method for getting the number of sectors. Should not be called directly.

partitionNumber

Description:
  • Get the value of the partitionNumber property.

Source:

Get the value of the partitionNumber property.

partitionNumber

Description:
  • Set the partition number and calculate the partition offset in bytes.

Source:

Set the partition number and calculate the partition offset in bytes.

partitionNumber

Description:
  • Get the value of the partitionNumber property.

Source:

Get the value of the partitionNumber property.

partitionNumber

Description:
  • Set the partition number and calculate the partition offset in bytes.

Source:

Set the partition number and calculate the partition offset in bytes.

partitionOffsetBytes

Description:
  • Returns the offset bytes for the currently selected partition

Source:

Returns the offset bytes for the currently selected partition

partitionOffsetBytes

Description:
  • Returns the offset bytes for the currently selected partition

Source:

Returns the offset bytes for the currently selected partition

readOnly

Description:
  • Get the value of the readOnly property.

Source:

Get the value of the readOnly property.

readOnly

Description:
  • Get the value of the readOnly property.

Source:

Get the value of the readOnly property.

sectorSize

Description:
  • Get the sector size.

Source:

Get the sector size.

sectorSize

Description:
  • Get the sector size.

Source:

Get the sector size.

Methods

checkSectorLength(dest)

Description:
  • Checks if the length of a destination buffer is a multiple of the sector size.

Source:
Parameters:
Name Type Description
dest any

The destination buffer to check.

Throws:

Throws an error if the buffer length is not a multiple of the sector size.

Type
Error

checkSectorLength(dest)

Description:
  • Checks if the length of a destination buffer is a multiple of the sector size.

Source:
Parameters:
Name Type Description
dest any

The destination buffer to check.

Throws:

Throws an error if the buffer length is not a multiple of the sector size.

Type
Error

parsePartitionsFromBuffer(buffer) → {Array}

Description:
  • Parses partitions from a buffer. Reads a FAT16 MBR and returns an array of partition offsets.

Source:
Parameters:
Name Type Description
buffer Buffer

The buffer to parse partitions from.

Returns:

An array of partition offsets.

Type
Array

parsePartitionsFromBuffer(buffer) → {Array}

Description:
  • Parses partitions from a buffer. Reads a FAT16 MBR and returns an array of partition offsets.

Source:
Parameters:
Name Type Description
buffer Buffer

The buffer to parse partitions from.

Returns:

An array of partition offsets.

Type
Array

readPartitions()

Description:
  • Abstract method for reading partitions. Should not be called directly.

Source:
Throws:

Abstract method 'readPartitions' must be implemented

Type
Error

readPartitions()

Description:
  • Abstract method for reading partitions. Should not be called directly.

Source:
Throws:

Abstract method 'readPartitions' must be implemented

Type
Error

readSectors(i, dest, cb) → {undefined}

Description:
  • Abstract method for reading sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to read.

dest ArrayBuffer

The destination array to copy the sector data to.

cb function

The callback function to be called when the sector data has been copied.

Returns:

This function does not return a value.

Type
undefined

readSectors(i, dest, cb) → {undefined}

Description:
  • Abstract method for reading sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to read.

dest ArrayBuffer

The destination array to copy the sector data to.

cb function

The callback function to be called when the sector data has been copied.

Returns:

This function does not return a value.

Type
undefined

writeSectors(i, data, cb)

Description:
  • Abstract method for writing sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to write to.

data Buffer

The data to write to the sector.

cb function

The callback function to be called when the write operation is complete.

Throws:

Cannot write to read-only volume!

Type
Error

writeSectors(i, data, cb)

Description:
  • Abstract method for writing sectors. Should not be called directly.

Source:
Parameters:
Name Type Description
i number

The index of the sector to write to.

data Buffer

The data to write to the sector.

cb function

The callback function to be called when the write operation is complete.

Throws:

Cannot write to read-only volume!

Type
Error