Merge branch '2.7.x'

This commit is contained in:
Andy Wilkinson
2022-02-10 16:01:18 +00:00
2 changed files with 16 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -180,6 +180,11 @@ public class RandomAccessDataFile implements RandomAccessData {
return (n <= 0) ? 0 : moveOn(cap(n));
}
@Override
public int available() throws IOException {
return (int) RandomAccessDataFile.this.length - this.position;
}
/**
* Cap the specified value such that it cannot exceed the number of bytes
* remaining.