-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iqss/7309 s3 resource leaks #7313
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,7 @@ public boolean canDecodeInput(Object source) throws IOException { | |
|
||
@Override | ||
public boolean canDecodeInput(BufferedInputStream stream) throws IOException { | ||
//who closes this stream? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. guessing this method could/should close it but I didn't see where it was getting called. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are not calling these methods at this time. They are part of a builtin infrastructure for automatically matching ingest plugins to specific file types... We are not using it now, but we may go back to it. |
||
if (stream ==null){ | ||
throw new IllegalArgumentException("stream == null!"); | ||
} | ||
|
@@ -185,21 +186,21 @@ public boolean canDecodeInput(File file) throws IOException { | |
throw new IIOException("cannot read the input file"); | ||
} | ||
|
||
byte[] hdr4 = new byte[4]; | ||
// set-up a FileChannel instance for a given file object | ||
FileChannel srcChannel = new FileInputStream(file).getChannel(); | ||
|
||
// create a read-only MappedByteBuffer | ||
MappedByteBuffer buff = srcChannel.map(FileChannel.MapMode.READ_ONLY, 0, DTA_HEADER_SIZE); | ||
try (FileChannel srcChannel = new FileInputStream(file).getChannel();) { | ||
|
||
//printHexDump(buff, "hex dump of the byte-buffer"); | ||
// create a read-only MappedByteBuffer | ||
MappedByteBuffer buff = srcChannel.map(FileChannel.MapMode.READ_ONLY, 0, DTA_HEADER_SIZE); | ||
|
||
buff.rewind(); | ||
// printHexDump(buff, "hex dump of the byte-buffer"); | ||
|
||
dbgLog.fine("applying the dta test\n"); | ||
buff.rewind(); | ||
|
||
byte[] hdr4 = new byte[4]; | ||
buff.get(hdr4, 0, 4); | ||
dbgLog.fine("applying the dta test\n"); | ||
|
||
buff.get(hdr4, 0, 4); | ||
} | ||
dbgLog.fine("hex dump: 1st 4bytes =>" + | ||
new String(Hex.encodeHex(hdr4)) + "<-"); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW - this private method doesn't get used according to eclipse - do we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really appears an unused leftover method.