Class MasterBootRecord
- java.lang.Object
-
- com.github.mjdev.libaums.partition.mbr.MasterBootRecord
-
- All Implemented Interfaces:
PartitionTable
public class MasterBootRecord extends java.lang.Object implements PartitionTable
This class represents the Master Boot Record (MBR), which is a partition table used by most block devices coming from Windows or Unix.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<PartitionTableEntry>getPartitionTableEntries()intgetSize()static MasterBootRecordread(java.nio.ByteBuffer buffer)Reads and parses the MBR located in the buffer.
-
-
-
Method Detail
-
read
public static MasterBootRecord read(java.nio.ByteBuffer buffer) throws java.io.IOException
Reads and parses the MBR located in the buffer.- Parameters:
buffer- The data which shall be examined.- Returns:
- A new
MasterBootRecord()or null if the data does not seem to be a MBR. - Throws:
java.io.IOException
-
getSize
public int getSize()
- Specified by:
getSizein interfacePartitionTable- Returns:
- The size in bytes the partition table occupies.
-
getPartitionTableEntries
public java.util.List<PartitionTableEntry> getPartitionTableEntries()
- Specified by:
getPartitionTableEntriesin interfacePartitionTable- Returns:
- A collection of
PartitionTableEntrys located on the block device.
-
-