file_path
stringlengths 54
199
| method_name
stringlengths 0
208
| method_block
stringlengths 0
57.6k
| method_name_pointers
sequencelengths 2
2
| length
int64 0
57.6k
|
---|---|---|---|---|
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | load | public void load() throws IOException {
myReader = new ExeReader(myTemplate.getFileName().toString());
try (var stream = new OffsetTrackingInputStream(new DataInputStream(Files.newInputStream(myTemplate)))) {
myReader.read(stream);
}
var resourceSection = (ResourceSectionReader)myReader.getSectionReader(Section.RESOURCES_SECTION_NAME);
myRoot = resourceSection.getRoot();
var subDir = myRoot.findSubDir(DirectoryEntry.RT_STRING);
myStringTableDirectory = subDir != null ? new StringTableDirectory(subDir) : null;
var versionInfoResource = getVersionInfoResource();
myVersionInfo = new VersionInfo();
myVersionInfo.read(new OffsetTrackingInputStream(new DataInputStream(new ByteArrayInputStream(versionInfoResource.getBytes()))));
} | [
12,
16
] | 784 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | getVersionInfoResource | private RawResource getVersionInfoResource() {
return myRoot.findSubDir(DirectoryEntry.RT_VERSION).findSubDir(1).getRawResource();
} | [
20,
42
] | 138 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | generate | public void generate() throws IOException {
if (myStringTableDirectory != null) {
myStringTableDirectory.save();
}
saveVersionInfo();
myReader.resetOffsets(0);
myReader.sectionVirtualAddressFixup();
Files.deleteIfExists(myExePath);
Files.createDirectories(myExePath.getParent());
try (var stream = new DataOutputStream(Files.newOutputStream(myExePath))) {
myReader.write(stream);
}
verifySize();
verifySections();
verifyVersionInfo();
} | [
12,
20
] | 502 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | saveVersionInfo | private void saveVersionInfo() throws IOException {
var out = new ByteArrayOutputStream();
myVersionInfo.resetOffsets(0);
myVersionInfo.write(new DataOutputStream(out));
getVersionInfoResource().setBytes(out.toByteArray());
} | [
13,
28
] | 243 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | verifySize | private void verifySize() throws IOException {
long fileSize = Files.size(myExePath), exeSize = myReader.sizeInBytes();
if (fileSize != exeSize) {
throw new RuntimeException(format("Produced file size mismatch, on disk: %d, in memory %d", fileSize, exeSize));
}
} | [
13,
23
] | 283 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | verifySections | private void verifySections() {
var imageOptionalHeader = myReader.getPeHeader().getImageOptionalHeader();
int FileAlignment = (int)imageOptionalHeader.getFileAlignment().getValue();
int SectionAlignment = (int)imageOptionalHeader.getSectionAlignment().getValue();
var errors = new ArrayList<String>();
var sections = myReader.getSectionHeaders();
for (var header : sections) {
var name = header.getSectionName();
long sizeOfRawData = header.getSizeOfRawData().getValue();
long pointerToRawData = header.getPointerToRawData().getValue();
long virtualAddress = header.getVirtualAddress().getValue();
long virtualSize = header.getVirtualSize().getValue();
if (pointerToRawData == 0) {
errors.add(format("Section '%s' may not have zero PointerToRawData", name));
}
if (virtualAddress == 0) {
errors.add(format("Section '%s' may not have zero VirtualAddress", name));
}
if (sizeOfRawData % FileAlignment != 0) {
errors.add(format("SizeOfRawData of section '%s' isn't dividable by 'FileAlignment' (%#x): %#x", name, FileAlignment, sizeOfRawData));
}
if (pointerToRawData % FileAlignment != 0) {
errors.add(format("PointerToRawData of section '%s' isn't dividable by 'FileAlignment' (%#x): %#x", name, FileAlignment, pointerToRawData));
}
if (virtualAddress % SectionAlignment != 0) {
errors.add(format("VirtualAddress of section '%s' isn't dividable by 'SectionAlignment' (%#x): %#x", name, SectionAlignment, virtualAddress));
}
if (name.equals(Section.RESOURCES_SECTION_NAME) && virtualSize < sizeOfRawData) {
errors.add(format("VirtualSize of section '%s' is smaller than SizeOfRawData (%#x): %#x", name, sizeOfRawData, virtualSize));
}
}
var imageDataDirs = imageOptionalHeader.getImageDataDirectories();
check(errors, "resources",
imageDataDirs.get(ImageDataDirectory.IMAGE_DIRECTORY_ENTRY_RESOURCE),
getSection(sections, Section.RESOURCES_SECTION_NAME));
check(errors, "relocations",
imageDataDirs.get(ImageDataDirectory.IMAGE_DIRECTORY_ENTRY_BASERELOC),
getSection(sections, Section.RELOCATIONS_SECTION_NAME));
// SizeOfImage: The size of the image, in bytes, including all headers. Must be a multiple of SectionAlignment.
long sizeOfImage = imageOptionalHeader.getSizeOfImage().getValue();
if (sizeOfImage % SectionAlignment != 0) {
errors.add(format("SizeOfImage isn't dividable by 'SectionAlignment' (%#x): %#x", SectionAlignment, sizeOfImage));
}
if (!errors.isEmpty()) {
var msg = new StringBuilder();
msg.append("Output verification failed with ").append(errors.size()).append(" error");
if (errors.size() > 1) msg.append("s");
msg.append(":\n");
for (String error : errors) {
msg.append('\t').append(error).append('\n');
}
throw new RuntimeException(msg.toString());
}
} | [
13,
27
] | 2,994 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | check | private static void check(List<String> errors, String name, ImageDataDirectory idd, ImageSectionHeader ish) {
long iddSize = idd.getSize().getValue();
long ishVirtualSize = ish.getVirtualSize().getValue();
if (iddSize != ishVirtualSize) {
errors.add(format("Incorrect '%s' sizes: %#x, %#x", name, iddSize, ishVirtualSize));
}
long iddAddress = idd.getVirtualAddress().getValue();
long ishAddress = ish.getVirtualAddress().getValue();
if (iddAddress != ishAddress) {
errors.add(format("Incorrect '%s' virtual address: %#x, %#x", name, iddAddress, ishAddress));
}
} | [
20,
25
] | 610 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | getSection | private static ImageSectionHeader getSection(Bin.ArrayOfBins<ImageSectionHeader> sections, String name) {
for (var header : sections) {
if (name.equals(header.getSectionName())) {
return header;
}
}
throw new IllegalStateException("Cannot find section with name " + name);
} | [
34,
44
] | 308 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | verifyVersionInfo | private void verifyVersionInfo() throws IOException {
var data1 = new ByteArrayOutputStream((int)myVersionInfo.sizeInBytes());
myVersionInfo.resetOffsets(0);
myVersionInfo.write(new DataOutputStream(data1));
var copy = new VersionInfo();
copy.read(new OffsetTrackingInputStream(new DataInputStream(new ByteArrayInputStream(data1.toByteArray()))));
copy.resetOffsets(0);
var data2 = new ByteArrayOutputStream((int)copy.sizeInBytes());
copy.write(new DataOutputStream(data2));
if (!Arrays.equals(data1.toByteArray(), data2.toByteArray())) {
throw new IllegalStateException("Load and save of VersionInfo produced different binary results");
}
} | [
13,
30
] | 691 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | setResourceString | public void setResourceString(int id, String value) {
if (myStringTableDirectory == null) throw new IllegalStateException("Cannot find string table in " + myTemplate);
myStringTableDirectory.setString(id, value);
} | [
12,
29
] | 224 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | setVersionInfoString | public void setVersionInfoString(String key, String value) {
myVersionInfo.getStringFileInfo().getSoleStringTable().setStringValue(key, value);
} | [
12,
32
] | 151 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | injectBitmap | @SuppressWarnings("unused")
public void injectBitmap(int id, byte[] bitmapFileData) {
DirectoryEntry subDirBmp = myRoot.findSubDir(DirectoryEntry.RT_BITMAP).findSubDir(id);
RawResource bmpRes = subDirBmp.getRawResource();
// strip off file header
byte[] bitmapResourceData = new byte[bitmapFileData.length - 14];
System.arraycopy(bitmapFileData, 14, bitmapResourceData, 0, bitmapResourceData.length);
bmpRes.setBytes(bitmapResourceData);
} | [
42,
54
] | 467 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | injectIcon | public void injectIcon(int id, final InputStream iconStream) throws IOException {
IconResourceInjector.injectIcon(iconStream, myRoot, id);
} | [
12,
22
] | 146 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | setFileVersionNumber | public void setFileVersionNumber(int[] parts) {
myVersionInfo.getFixedFileInfo().setFileVersion(parts[0] << 16 | parts[1], parts[2] << 16 | parts[3]);
} | [
12,
32
] | 158 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGenerator.java | setProductVersionNumber | public void setProductVersionNumber(int[] parts) {
myVersionInfo.getFixedFileInfo().setProductVersion(parts[0] << 16 | parts[1], parts[2] << 16 | parts[3]);
} | [
12,
35
] | 164 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGeneratorMain.java | main | public static void main(String... args) {
if (args.length != 5) {
System.err.println(
"Usage: LauncherGeneratorMain <template .exe file> <resource.h file> <properties file> <.ico file> <output .exe file>");
System.exit(1);
}
var templateFile = Path.of(args[0]);
if (!Files.isRegularFile(templateFile)) {
System.err.println("Launcher template .exe file '" + args[0] + "' not found");
System.exit(2);
}
var resourceHeaderFile = Path.of(args[1]);
if (!Files.isRegularFile(templateFile)) {
System.err.println("Resource header file '" + args[1] + "' not found");
System.exit(3);
}
var resourceIDs = new HashMap<String, Integer>();
try (var lines = Files.lines(resourceHeaderFile)) {
var pattern = Pattern.compile("#define (\\w+)\\s+(\\d+)");
lines.map(pattern::matcher).filter(Matcher::matches).forEach(m -> {
resourceIDs.put(m.group(1), Integer.parseInt(m.group(2)));
});
}
catch (IOException | NumberFormatException e) {
System.err.println("Error loading '" + resourceHeaderFile + "': " + e.getMessage());
System.exit(3);
}
if (resourceIDs.get("IDI_WINLAUNCHER") == null) {
System.err.println("Key 'IDI_WINLAUNCHER' is missing from '" + resourceHeaderFile);
System.exit(3);
}
var propertiesFile = Path.of(args[2]);
if (!Files.isRegularFile(propertiesFile)) {
System.err.println("Properties file '" + args[2] + "' not found");
System.exit(4);
}
var properties = new Properties();
try {
try (var inputStream = Files.newInputStream(propertiesFile)) {
properties.load(inputStream);
}
}
catch (IOException e) {
System.err.println("Error loading '" + propertiesFile + "': " + e.getMessage());
System.exit(4);
}
for (var key : properties.stringPropertyNames()) {
if (key.startsWith("IDS_") && resourceIDs.get(key) == null) {
System.err.println("Key '" + key + "' is missing from '" + resourceHeaderFile);
System.exit(3);
}
}
var fileVersion = properties.getProperty("FileVersion");
var productVersion = properties.getProperty("ProductVersion");
if (productVersion == null) {
System.err.println("Key 'ProductVersion' is missing from '" + propertiesFile);
System.exit(4);
}
var productCodeSeparator = productVersion.indexOf('-');
if (productCodeSeparator > 0) {
productVersion = productVersion.substring(0, productCodeSeparator);
}
var icoFile = Path.of(args[3]);
if (!Files.isRegularFile(icoFile)) {
System.err.println("Icon file '" + args[3] + "' not found");
System.exit(5);
}
var outputFile = Path.of(args[4]);
var generator = new LauncherGenerator(templateFile, outputFile);
try {
generator.load();
for (var key : properties.stringPropertyNames()) {
if (key.startsWith("IDS_")) {
generator.setResourceString(resourceIDs.get(key), properties.getProperty(key));
}
else {
generator.setVersionInfoString(key, properties.getProperty(key));
}
}
generator.setVersionInfoString("OriginalFilename", outputFile.getFileName().toString());
try (var iconStream = Files.newInputStream(icoFile)) {
generator.injectIcon(resourceIDs.get("IDI_WINLAUNCHER"), iconStream);
}
if (fileVersion != null) {
generator.setFileVersionNumber(splitVersion(fileVersion));
}
generator.setProductVersionNumber(splitVersion(productVersion));
generator.generate();
}
catch (IOException e) {
e.printStackTrace();
System.exit(6);
}
} | [
19,
23
] | 3,703 |
intellij-community/tools/launcher-generator/src/com/pme/launcher/LauncherGeneratorMain.java | splitVersion | private static int[] splitVersion(String version) {
try {
var parts = Stream.of(version.split("\\.")).mapToInt(Integer::parseInt).toArray();
if (parts.length != 4) throw new IllegalArgumentException("Invalid version format: " + version);
return parts;
}
catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid version format: " + version);
}
} | [
21,
33
] | 407 |
intellij-community/tools/launcher-generator/src/com/pme/util/StreamUtil.java | getOffset | public static long getOffset(DataInput stream) throws IOException {
if (stream instanceof OffsetTrackingInputStream otis) return otis.getOffset();
if (stream instanceof RandomAccessFile raf) return raf.getFilePointer();
throw new IOException("OffsetTrackingInputStream or RandomAccessFile expected, got " + stream.getClass().getName());
} | [
19,
28
] | 352 |
intellij-community/tools/launcher-generator/src/com/pme/util/StreamUtil.java | getOffset | public static long getOffset(DataOutput stream) throws IOException {
if (stream instanceof RandomAccessFile raf) return raf.getFilePointer();
if (stream instanceof DataOutputStream dos) return dos.size();
throw new IOException("RandomAccessFile or DataOutputStream expected, got " + stream.getClass().getName());
} | [
19,
28
] | 328 |
intellij-community/tools/launcher-generator/src/com/pme/util/StreamUtil.java | seek | public static void seek(DataInput stream, long pos) throws IOException {
if (stream instanceof OffsetTrackingInputStream inputStream) {
long current = inputStream.getOffset();
if (current < pos) {
inputStream.skipBytes((int)(pos - current));
} else {
throw new IOException(String.format("Cannot go backwards in OffsetTrackingInputStream: current offset %#010x, seek %#010x", current, pos));
}
return;
}
if (stream instanceof RandomAccessFile raf) {
raf.seek(pos);
return;
}
throw new IOException("OffsetTrackingInputStream or RandomAccessFile expected, got " + stream.getClass().getName());
} | [
19,
23
] | 672 |
intellij-community/tools/launcher-generator/src/com/pme/util/BitsUtil.java | intToHexString | public static String intToHexString( long value ){
return String.format("0x%08x", (int)value);
} | [
21,
35
] | 102 |
intellij-community/tools/launcher-generator/src/com/pme/util/BitsUtil.java | shortToHexString | public static String shortToHexString( int value ){
return String.format("0x%04x", (short)value);
} | [
21,
37
] | 105 |
intellij-community/tools/launcher-generator/src/com/pme/util/BitsUtil.java | byteToHexString | public static String byteToHexString( int value ){
return String.format("0x%02x", (byte)value);
} | [
21,
36
] | 103 |
intellij-community/tools/launcher-generator/src/com/pme/util/BitsUtil.java | readChar | public static char readChar(DataInput stream) throws IOException {
int b1 = stream.readByte();
int b2 = stream.readByte();
return (char) (b1 & 0xFF | ((b2 & 0xFF) << 8));
} | [
19,
27
] | 186 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | getOffset | public long getOffset() {
return myOffset;
} | [
12,
21
] | 50 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readFully | @Override
public void readFully(byte[] b) throws IOException {
myBaseStream.readFully(b);
myOffset += b.length;
} | [
24,
33
] | 125 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readFully | @Override
public void readFully(byte[] b, int off, int len) throws IOException {
myBaseStream.readFully(b, off, len);
myOffset += len;
} | [
24,
33
] | 148 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | skipBytes | @Override
public int skipBytes(int n) throws IOException {
int skipped = myBaseStream.skipBytes(n);
myOffset += skipped;
return skipped;
} | [
23,
32
] | 154 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readBoolean | @Override
public boolean readBoolean() throws IOException {
myOffset++;
return myBaseStream.readBoolean();
} | [
27,
38
] | 120 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readByte | @Override
public byte readByte() throws IOException {
myOffset++;
return myBaseStream.readByte();
} | [
24,
32
] | 111 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readUnsignedByte | @Override
public int readUnsignedByte() throws IOException {
myOffset++;
return myBaseStream.readUnsignedByte();
} | [
23,
39
] | 126 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readShort | @Override
public short readShort() throws IOException {
myOffset += 2;
return myBaseStream.readShort();
} | [
25,
34
] | 117 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readUnsignedShort | @Override
public int readUnsignedShort() throws IOException {
myOffset += 2;
return myBaseStream.readUnsignedShort();
} | [
23,
40
] | 131 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readChar | @Override
public char readChar() throws IOException {
myOffset += 2;
return myBaseStream.readChar();
} | [
24,
32
] | 114 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readInt | @Override
public int readInt() throws IOException {
myOffset += 4;
return myBaseStream.readInt();
} | [
23,
30
] | 111 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readLong | @Override
public long readLong() throws IOException {
myOffset += 8;
return myBaseStream.readLong();
} | [
24,
32
] | 114 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readFloat | @Override
public float readFloat() throws IOException {
myOffset += 4;
return myBaseStream.readFloat();
} | [
25,
34
] | 117 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readDouble | @Override
public double readDouble() throws IOException {
myOffset += 8;
return myBaseStream.readDouble();
} | [
26,
36
] | 120 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readLine | @Override
public String readLine() {
throw new UnsupportedOperationException();
} | [
26,
34
] | 89 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | readUTF | @Override
public String readUTF() {
throw new UnsupportedOperationException();
} | [
26,
33
] | 88 |
intellij-community/tools/launcher-generator/src/com/pme/util/OffsetTrackingInputStream.java | close | @Override
public void close() throws IOException {
myBaseStream.close();
} | [
24,
29
] | 82 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getName | public String getName() {
return myName;
} | [
14,
21
] | 48 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setName | public void setName(String name) {
myName = name;
} | [
12,
19
] | 57 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getDescription | public String getDescription() {
if (myDescription != null) {
return myDescription;
}
return myName;
} | [
14,
28
] | 122 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getOffset | public long getOffset() {
return myOffset;
} | [
12,
21
] | 50 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | resetOffsets | public void resetOffsets(long offset) {
myOffset = offset;
updateSizeOffsetHolders();
} | [
12,
24
] | 97 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | updateSizeOffsetHolders | protected void updateSizeOffsetHolders() {
for (Value holder : myOffsetHolders) {
holder.setValue(myOffset);
}
for (Value holder : mySizeHolders) {
holder.setValue(sizeInBytes());
}
} | [
15,
38
] | 213 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | copyFrom | public void copyFrom(Bin value) {
} | [
12,
20
] | 37 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | addOffsetHolder | public void addOffsetHolder(Value offsetHolder) {
myOffsetHolders.add( offsetHolder );
} | [
12,
27
] | 94 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | addSizeHolder | public void addSizeHolder(Value sizeHolder) {
mySizeHolders.add( sizeHolder );
} | [
12,
25
] | 86 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | sizeInBytes | public abstract long sizeInBytes(); | [
21,
32
] | 35 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setDescription | public void setDescription(String description) {
myDescription = description;
} | [
12,
26
] | 85 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | read | public abstract void read(DataInput stream) throws IOException; | [
21,
25
] | 63 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | write | public abstract void write(DataOutput stream) throws IOException; | [
21,
26
] | 65 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | report | public abstract void report(OutputStreamWriter writer) throws IOException; | [
21,
27
] | 74 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | resetOffsets | @Override
public void resetOffsets(long newOffset) {
super.resetOffsets(newOffset);
long offset = getOffset();
for (Bin bin : myMembers) {
bin.resetOffsets(offset);
offset += bin.sizeInBytes();
}
updateSizeOffsetHolders();
} | [
26,
38
] | 278 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | copyFrom | @Override
public void copyFrom(Bin binStructure) {
Bin.Structure structure = (Bin.Structure)binStructure;
ArrayList<Bin> members = structure.getMembers();
for (Bin bin : members) {
Bin valueMember = myMembersMap.get(bin.getName());
if (valueMember != null) {
valueMember.copyFrom(bin);
}
}
} | [
26,
34
] | 357 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | sizeInBytes | @Override
public long sizeInBytes() {
long size = 0;
for (Bin bin : myMembers) {
size += bin.sizeInBytes();
}
return size;
} | [
26,
37
] | 164 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getMembers | public ArrayList<Bin> getMembers() {
return myMembers;
} | [
22,
32
] | 66 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | addMember | public <T extends Bin> T addMember(T bin, String description) {
bin.setDescription(description);
return addMember(bin);
} | [
25,
34
] | 137 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | addMember | public <T extends Bin> T addMember(T bin) {
myMembers.add(bin);
addMemberToMapOnly(bin);
return bin;
} | [
25,
34
] | 124 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | addMemberToMapOnly | public void addMemberToMapOnly(Bin bin) {
myMembersMap.put(bin.getName(), bin);
} | [
12,
30
] | 91 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | read | @Override
public void read(DataInput stream) throws IOException {
for (Bin bin : myMembers) {
bin.read(stream);
}
} | [
26,
30
] | 143 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | write | @Override
public void write(DataOutput stream) throws IOException {
for (Bin bin : myMembers) {
bin.write(stream);
}
} | [
26,
31
] | 146 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | report | @Override
public void report(OutputStreamWriter writer) throws IOException {
_report(writer, "--- '" + getName() + "' Structure --- size = " + sizeInBytes());
_report(writer, "{Offset = " + Long.toHexString(getOffset()) + "}");
for (Bin bin : myMembers) {
bin.report(writer);
}
_report(writer, "--- End Of '" + getName() + "' Structure ---");
} | [
26,
32
] | 390 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getValue | public abstract long getValue(); | [
21,
29
] | 32 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setValue | public abstract Value setValue(long value); | [
22,
30
] | 43 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | copyFrom | @Override
public void copyFrom(Bin value) {
setValue(((Value)value).getValue());
} | [
26,
34
] | 96 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getRawValue | public long getRawValue() {
return myValue;
} | [
12,
23
] | 55 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setRawValue | public void setRawValue(long value) {
myValue = value;
} | [
12,
23
] | 66 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | sizeInBytes | @Override
public long sizeInBytes() {
throw new IllegalStateException();
} | [
26,
37
] | 88 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | read | @Override
public void read(DataInput stream) {
throw new IllegalStateException();
} | [
26,
30
] | 97 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | write | @Override
public void write(DataOutput stream) {
throw new IllegalStateException();
} | [
26,
31
] | 99 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | report | @Override
public void report(OutputStreamWriter writer) {
throw new IllegalStateException();
} | [
26,
32
] | 108 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setValue | @Override
public Value setValue(long value) {
throw new IllegalStateException();
} | [
27,
35
] | 96 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | sizeInBytes | @Override
public long sizeInBytes() {
return 1;
} | [
26,
37
] | 63 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getValue | @Override
public long getValue() {
return getRawValue();
} | [
26,
34
] | 72 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setValue | @Override
public Byte setValue(long value) {
setRawValue(value);
return this;
} | [
26,
34
] | 99 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | read | @Override
public void read(DataInput stream) throws IOException {
setRawValue(stream.readByte());
} | [
26,
30
] | 113 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | write | @Override
public void write(DataOutput stream) throws IOException {
stream.writeByte((byte)getRawValue());
} | [
26,
31
] | 122 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | report | @Override
public void report(OutputStreamWriter writer) throws IOException {
_report(writer, getDescription(), (byte)getValue());
} | [
26,
32
] | 145 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | toString | public String toString() {
return BitsUtil.byteToHexString((int)getValue());
} | [
14,
22
] | 88 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | sizeInBytes | @Override
public long sizeInBytes() {
return 2;
} | [
26,
37
] | 63 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getValue | @Override
public long getValue() {
return Short.toUnsignedLong(Short.reverseBytes((short) super.getRawValue()));
} | [
26,
34
] | 128 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setValue | @Override
public Word setValue(long value) {
setRawValue(Short.toUnsignedLong(Short.reverseBytes((short)value)));
return this;
} | [
26,
34
] | 148 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | read | @Override
public void read(DataInput stream) throws IOException {
setRawValue(stream.readShort());
} | [
26,
30
] | 114 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | write | @Override
public void write(DataOutput stream) throws IOException {
stream.writeShort((short) getRawValue());
} | [
26,
31
] | 125 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | report | @Override
public void report(OutputStreamWriter writer) throws IOException {
short sh = (short) getValue();
_report(writer, getDescription(), sh);
} | [
26,
32
] | 168 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | toString | public String toString() {
return BitsUtil.shortToHexString( (int)getValue() );
} | [
14,
22
] | 91 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | sizeInBytes | @Override
public long sizeInBytes() {
return 4;
} | [
26,
37
] | 63 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setValue | @Override
public DWord setValue(long value) {
setRawValue(Integer.toUnsignedLong(Integer.reverseBytes((int)value)));
return this;
} | [
27,
35
] | 151 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getValue | @Override
public long getValue() {
return Integer.toUnsignedLong(Integer.reverseBytes((int) super.getRawValue()));
} | [
26,
34
] | 130 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | read | @Override
public void read(DataInput stream) throws IOException {
setRawValue(stream.readInt());
} | [
26,
30
] | 112 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | write | @Override
public void write(DataOutput stream) throws IOException {
stream.writeInt((int) getRawValue());
} | [
26,
31
] | 121 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | report | @Override
public void report(OutputStreamWriter writer) throws IOException {
_report(writer, getDescription(), (int) getValue());
} | [
26,
32
] | 145 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | toString | public String toString() {
return BitsUtil.intToHexString( (int)getValue() );
} | [
14,
22
] | 89 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | getValue | @Override
public long getValue() {
return Long.reverseBytes(getRawValue());
} | [
26,
34
] | 91 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | setValue | @Override
public LongLong setValue(long value) {
setRawValue(Long.reverseBytes(value));
return this;
} | [
30,
38
] | 122 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | sizeInBytes | @Override
public long sizeInBytes() {
return 8;
} | [
26,
37
] | 63 |
intellij-community/tools/launcher-generator/src/com/pme/exe/Bin.java | read | @Override
public void read(DataInput stream) throws IOException {
setRawValue(stream.readLong());
} | [
26,
30
] | 113 |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 0