Skip to content

Commit 8d69dc2

Browse files
committed
search: use IFile.readNBytes(int)
1 parent 991408d commit 8d69dc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bundles/org.eclipse.search.core/search/org/eclipse/search/internal/core/text/FileCharSequenceProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ public String toString() {
491491
* get length
492492
*/
493493
private static String toShortString(IFile file) {
494-
try (InputStream contents = file.getContents()) {
495-
byte[] content = contents.readNBytes(MAX_BUFFER_LENGTH);
494+
try {
495+
byte[] content = file.readNBytes(MAX_BUFFER_LENGTH);
496496
int length = content.length;
497497
if (length >= MAX_BUFFER_LENGTH) {
498498
return null;

0 commit comments

Comments
 (0)