Skip to content

Commit

Permalink
Remove some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Feb 12, 2022
1 parent a79e0f4 commit 70745e0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
11 changes: 3 additions & 8 deletions src/main/java/net/fornwall/jelf/BackingFile.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package net.fornwall.jelf;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.Buffer;
import java.nio.MappedByteBuffer;

interface BackingFile {

public void seek(long offset);
public void skip(int bytesToSkip);
void seek(long offset);
void skip(int bytesToSkip);
short readUnsignedByte();
public int read(byte[] data);
int read(byte[] data);

}
2 changes: 0 additions & 2 deletions src/main/java/net/fornwall/jelf/ByteArrayAsFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.Buffer;
import java.nio.MappedByteBuffer;

class ByteArrayAsFile implements BackingFile{
private final ByteArrayInputStream byteArray;
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/net/fornwall/jelf/ElfFile.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package net.fornwall.jelf;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -508,11 +506,11 @@ public static ElfFile from(File file) throws ElfException, IOException {
return from(buffer);
}

public static ElfFile from(byte[] buffer) throws ElfException, IOException {
public static ElfFile from(byte[] buffer) throws ElfException {
return new ElfFile(new ByteArrayAsFile(buffer));
}

public static ElfFile from(MappedByteBuffer mappedByteBuffer) throws ElfException, IOException {
public static ElfFile from(MappedByteBuffer mappedByteBuffer) throws ElfException {
return new ElfFile(new MappedFile(mappedByteBuffer));
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/net/fornwall/jelf/MappedFile.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package net.fornwall.jelf;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.Buffer;
import java.nio.MappedByteBuffer;
import java.nio.ByteBuffer;

Expand Down

0 comments on commit 70745e0

Please sign in to comment.