Package com.github.junrar.rarfile
Class BaseBlock
- java.lang.Object
-
- com.github.junrar.rarfile.BaseBlock
-
- Direct Known Subclasses:
AVHeader,BlockHeader,CommentHeader,EndArcHeader,MainHeader,MarkHeader,SignHeader
public class BaseBlock extends java.lang.ObjectBase class of all rar headers- Version:
- $LastChangedRevision$
-
-
Field Summary
Fields Modifier and Type Field Description static shortBaseBlockSizestatic shortEARC_DATACRCstatic shortEARC_NEXT_VOLUMEstatic shortEARC_REVSPACEstatic shortEARC_VOLNUMBERprotected shortflagsprotected shortheadCRCprotected shortheaderSizeprotected byteheaderTypestatic shortLHD_COMMENTstatic shortLHD_DIRECTORYstatic shortLHD_EXTFLAGSstatic shortLHD_EXTTIMEstatic shortLHD_LARGEstatic shortLHD_PASSWORDstatic shortLHD_SALTstatic shortLHD_SOLIDstatic shortLHD_SPLIT_AFTERstatic shortLHD_SPLIT_BEFOREstatic shortLHD_UNICODEstatic shortLHD_VERSIONstatic shortLHD_WINDOW1024static shortLHD_WINDOW128static shortLHD_WINDOW2048static shortLHD_WINDOW256static shortLHD_WINDOW4096static shortLHD_WINDOW512static shortLHD_WINDOW64static shortLHD_WINDOWMASKprivate static org.slf4j.Loggerloggerstatic shortLONG_BLOCKstatic shortMHD_AVstatic shortMHD_COMMENTstatic shortMHD_ENCRYPTVERstatic shortMHD_FIRSTVOLUMEstatic shortMHD_LOCKstatic shortMHD_NEWNUMBERINGstatic shortMHD_PACK_COMMENTstatic shortMHD_PASSWORDstatic shortMHD_PROTECTstatic shortMHD_SOLIDstatic shortMHD_VOLUMEprotected longpositionInFilestatic shortSKIP_IF_UNKNOWN
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description shortgetFlags()shortgetHeadCRC()private shortgetHeaderPaddingSize()shortgetHeaderSize()Deprecated.As of 7.3.0, replaced bygetHeaderSize(boolean)shortgetHeaderSize(boolean encrypted)The header size, padded if encrypted.UnrarHeadertypegetHeaderType()longgetPositionInFile()booleanhasArchiveDataCRC()booleanhasEncryptVersion()booleanhasVolumeNumber()booleanisSubBlock()voidprint()voidsetPositionInFile(long positionInFile)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
BaseBlockSize
public static final short BaseBlockSize
- See Also:
- Constant Field Values
-
MHD_VOLUME
public static final short MHD_VOLUME
- See Also:
- Constant Field Values
-
MHD_COMMENT
public static final short MHD_COMMENT
- See Also:
- Constant Field Values
-
MHD_LOCK
public static final short MHD_LOCK
- See Also:
- Constant Field Values
-
MHD_SOLID
public static final short MHD_SOLID
- See Also:
- Constant Field Values
-
MHD_PACK_COMMENT
public static final short MHD_PACK_COMMENT
- See Also:
- Constant Field Values
-
MHD_NEWNUMBERING
public static final short MHD_NEWNUMBERING
- See Also:
- Constant Field Values
-
MHD_AV
public static final short MHD_AV
- See Also:
- Constant Field Values
-
MHD_PROTECT
public static final short MHD_PROTECT
- See Also:
- Constant Field Values
-
MHD_PASSWORD
public static final short MHD_PASSWORD
- See Also:
- Constant Field Values
-
MHD_FIRSTVOLUME
public static final short MHD_FIRSTVOLUME
- See Also:
- Constant Field Values
-
MHD_ENCRYPTVER
public static final short MHD_ENCRYPTVER
- See Also:
- Constant Field Values
-
LHD_SPLIT_BEFORE
public static final short LHD_SPLIT_BEFORE
- See Also:
- Constant Field Values
-
LHD_SPLIT_AFTER
public static final short LHD_SPLIT_AFTER
- See Also:
- Constant Field Values
-
LHD_PASSWORD
public static final short LHD_PASSWORD
- See Also:
- Constant Field Values
-
LHD_COMMENT
public static final short LHD_COMMENT
- See Also:
- Constant Field Values
-
LHD_SOLID
public static final short LHD_SOLID
- See Also:
- Constant Field Values
-
LHD_WINDOWMASK
public static final short LHD_WINDOWMASK
- See Also:
- Constant Field Values
-
LHD_WINDOW64
public static final short LHD_WINDOW64
- See Also:
- Constant Field Values
-
LHD_WINDOW128
public static final short LHD_WINDOW128
- See Also:
- Constant Field Values
-
LHD_WINDOW256
public static final short LHD_WINDOW256
- See Also:
- Constant Field Values
-
LHD_WINDOW512
public static final short LHD_WINDOW512
- See Also:
- Constant Field Values
-
LHD_WINDOW1024
public static final short LHD_WINDOW1024
- See Also:
- Constant Field Values
-
LHD_WINDOW2048
public static final short LHD_WINDOW2048
- See Also:
- Constant Field Values
-
LHD_WINDOW4096
public static final short LHD_WINDOW4096
- See Also:
- Constant Field Values
-
LHD_DIRECTORY
public static final short LHD_DIRECTORY
- See Also:
- Constant Field Values
-
LHD_LARGE
public static final short LHD_LARGE
- See Also:
- Constant Field Values
-
LHD_UNICODE
public static final short LHD_UNICODE
- See Also:
- Constant Field Values
-
LHD_SALT
public static final short LHD_SALT
- See Also:
- Constant Field Values
-
LHD_VERSION
public static final short LHD_VERSION
- See Also:
- Constant Field Values
-
LHD_EXTTIME
public static final short LHD_EXTTIME
- See Also:
- Constant Field Values
-
LHD_EXTFLAGS
public static final short LHD_EXTFLAGS
- See Also:
- Constant Field Values
-
SKIP_IF_UNKNOWN
public static final short SKIP_IF_UNKNOWN
- See Also:
- Constant Field Values
-
LONG_BLOCK
public static final short LONG_BLOCK
- See Also:
- Constant Field Values
-
EARC_NEXT_VOLUME
public static final short EARC_NEXT_VOLUME
- See Also:
- Constant Field Values
-
EARC_DATACRC
public static final short EARC_DATACRC
- See Also:
- Constant Field Values
-
EARC_REVSPACE
public static final short EARC_REVSPACE
- See Also:
- Constant Field Values
-
EARC_VOLNUMBER
public static final short EARC_VOLNUMBER
- See Also:
- Constant Field Values
-
positionInFile
protected long positionInFile
-
headCRC
protected short headCRC
-
headerType
protected byte headerType
-
flags
protected short flags
-
headerSize
protected short headerSize
-
-
Constructor Detail
-
BaseBlock
public BaseBlock()
-
BaseBlock
public BaseBlock(BaseBlock bb)
-
BaseBlock
public BaseBlock(byte[] baseBlockHeader)
-
-
Method Detail
-
hasArchiveDataCRC
public boolean hasArchiveDataCRC()
-
hasVolumeNumber
public boolean hasVolumeNumber()
-
hasEncryptVersion
public boolean hasEncryptVersion()
-
isSubBlock
public boolean isSubBlock()
- Returns:
- is it a sub block
-
getPositionInFile
public long getPositionInFile()
-
getFlags
public short getFlags()
-
getHeadCRC
public short getHeadCRC()
-
getHeaderSize
@Deprecated public short getHeaderSize()
Deprecated.As of 7.3.0, replaced bygetHeaderSize(boolean)The header size.- Returns:
- the header size
-
getHeaderSize
public short getHeaderSize(boolean encrypted)
The header size, padded if encrypted.- Parameters:
encrypted- if the header is encrypted.- Returns:
- the header size, and the padded header size if the header is encrypted.
-
getHeaderPaddingSize
private short getHeaderPaddingSize()
-
getHeaderType
public UnrarHeadertype getHeaderType()
-
setPositionInFile
public void setPositionInFile(long positionInFile)
-
print
public void print()
-
-