diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java index fd5d11a1c53e..426953d57765 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java @@ -104,7 +104,7 @@ private int readByte(long position) throws IOException { private int read(byte[] bytes, long position, int offset, int length) throws IOException { - if (position > this.length) { + if (position >= this.length) { return -1; } return this.fileAccess.read(bytes, this.offset + position, offset, length);