From 86551bf306f5eeb9386d36c16d051cb7c346023d Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 7 Mar 2019 01:28:04 +0100 Subject: [PATCH] Turn "convertRPX" into a static method --- src/main/java/rpx/RPXFileSystem.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/rpx/RPXFileSystem.java b/src/main/java/rpx/RPXFileSystem.java index a837e02..a1a9c9f 100644 --- a/src/main/java/rpx/RPXFileSystem.java +++ b/src/main/java/rpx/RPXFileSystem.java @@ -84,7 +84,7 @@ public class RPXFileSystem implements GFileSystem { public void mount(TaskMonitor monitor) { monitor.setMessage("Opening " + RPXFileSystem.class.getSimpleName() + "..."); try { - ElfData data = convertRPX(); + ElfData data = convertRPX(provider); fsih.storeFile("converted.elf", 0, false, data.elf_size, data); } catch (Exception e) { e.printStackTrace(); @@ -96,8 +96,8 @@ public class RPXFileSystem implements GFileSystem { * * @return */ - public ElfData convertRPX() throws ElfException, IOException, DataFormatException { - ElfHeader elfFile = ElfHeader.createElfHeader(RethrowContinuesFactory.INSTANCE, provider); + public static ElfData convertRPX(ByteProvider bProvider) throws ElfException, IOException, DataFormatException { + ElfHeader elfFile = ElfHeader.createElfHeader(RethrowContinuesFactory.INSTANCE, bProvider); elfFile.parse(); long shdr_elf_offset = elfFile.e_ehsize() & 0xFFFFFFFF; @@ -174,7 +174,7 @@ public class RPXFileSystem implements GFileSystem { byte[] dataArray = buffer.array(); - return new ElfData(dataArray, (int) provider.length()); + return new ElfData(dataArray, (int) bProvider.length()); } private static ByteBuffer checkBuffer(ByteBuffer buffer, long newEnd) {