Skip to content

Commit fae5ae9

Browse files
committed
Normalize internal method name
1 parent 86b5da5 commit fae5ae9

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ public int available() throws IOException {
170170
return buffer.remaining();
171171
}
172172

173+
private void checkOpen() throws IOException {
174+
if (closed) {
175+
throw new IOException("Stream closed");
176+
}
177+
}
178+
173179
private void cleanBuffer() {
174180
if (ByteBufferCleaner.isSupported() && buffer.isDirect()) {
175181
ByteBufferCleaner.clean(buffer);
@@ -186,12 +192,6 @@ public void close() throws IOException {
186192
}
187193
}
188194

189-
private void ensureOpen() throws IOException {
190-
if (closed) {
191-
throw new IOException("Stream closed");
192-
}
193-
}
194-
195195
int getBufferSize() {
196196
return bufferSize;
197197
}
@@ -210,7 +210,7 @@ private void nextBuffer() throws IOException {
210210

211211
@Override
212212
public int read() throws IOException {
213-
ensureOpen();
213+
checkOpen();
214214
if (!buffer.hasRemaining()) {
215215
nextBuffer();
216216
if (!buffer.hasRemaining()) {
@@ -222,7 +222,7 @@ public int read() throws IOException {
222222

223223
@Override
224224
public int read(final byte[] b, final int off, final int len) throws IOException {
225-
ensureOpen();
225+
checkOpen();
226226
if (!buffer.hasRemaining()) {
227227
nextBuffer();
228228
if (!buffer.hasRemaining()) {
@@ -236,7 +236,7 @@ public int read(final byte[] b, final int off, final int len) throws IOException
236236

237237
@Override
238238
public long skip(final long n) throws IOException {
239-
ensureOpen();
239+
checkOpen();
240240
if (n <= 0) {
241241
return 0;
242242
}

0 commit comments

Comments
 (0)