本文整理汇总了Java中org.springframework.boot.loader.data.RandomAccessData.getSubsection方法的典型用法代码示例。如果您正苦于以下问题:Java RandomAccessData.getSubsection方法的具体用法?Java RandomAccessData.getSubsection怎么用?Java RandomAccessData.getSubsection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.boot.loader.data.RandomAccessData
的用法示例。
在下文中一共展示了RandomAccessData.getSubsection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getArchiveData
import org.springframework.boot.loader.data.RandomAccessData; //导入方法依赖的package包/类
private RandomAccessData getArchiveData(CentralDirectoryEndRecord endRecord,
RandomAccessData data) {
long offset = endRecord.getStartOfArchive(data);
if (offset == 0) {
return data;
}
return data.getSubsection(offset, data.getSize() - offset);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:CentralDirectoryParser.java
示例2: getEntryData
import org.springframework.boot.loader.data.RandomAccessData; //导入方法依赖的package包/类
private RandomAccessData getEntryData(FileHeader entry) throws IOException {
// aspectjrt-1.7.4.jar has a different ext bytes length in the
// local directory to the central directory. We need to re-read
// here to skip them
RandomAccessData data = this.jarFile.getData();
byte[] localHeader = Bytes.get(
data.getSubsection(entry.getLocalHeaderOffset(), LOCAL_FILE_HEADER_SIZE));
long nameLength = Bytes.littleEndianValue(localHeader, 26, 2);
long extraLength = Bytes.littleEndianValue(localHeader, 28, 2);
return data.getSubsection(entry.getLocalHeaderOffset() + LOCAL_FILE_HEADER_SIZE
+ nameLength + extraLength, entry.getCompressedSize());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:JarFileEntries.java
示例3: getCentralDirectory
import org.springframework.boot.loader.data.RandomAccessData; //导入方法依赖的package包/类
/**
* Return the bytes of the "Central directory" based on the offset indicated in this
* record.
* @param data the source data
* @return the central directory data
*/
public RandomAccessData getCentralDirectory(RandomAccessData data) {
long offset = Bytes.littleEndianValue(this.block, this.offset + 16, 4);
long length = Bytes.littleEndianValue(this.block, this.offset + 12, 4);
return data.getSubsection(offset, length);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:CentralDirectoryEndRecord.java