From 6b3a7545e9fc3dfaa705edfd31cef2a26e8c8066 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 4 Mar 2014 17:10:50 +0400 Subject: [PATCH] cleanup --- .../intellij/util/io/MappedFileInputStream.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/util/src/com/intellij/util/io/MappedFileInputStream.java b/platform/util/src/com/intellij/util/io/MappedFileInputStream.java index c67c816e6578..10a57dcf4c5c 100644 --- a/platform/util/src/com/intellij/util/io/MappedFileInputStream.java +++ b/platform/util/src/com/intellij/util/io/MappedFileInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,24 +25,24 @@ import java.io.IOException; import java.io.InputStream; public class MappedFileInputStream extends InputStream { - private ResizeableMappedFile raf; + private final ResizeableMappedFile raf; private int cur; private long limit; - public MappedFileInputStream(final ResizeableMappedFile raf, final long pos, final long limit) { + public MappedFileInputStream(@NotNull ResizeableMappedFile raf, final long pos, final long limit) { this.raf = raf; setup(pos, limit); } + public MappedFileInputStream(@NotNull ResizeableMappedFile raf, final long pos) throws IOException { + this(raf, pos, raf.length()); + } + public void setup(final long pos, final long limit) { this.cur = (int)pos; this.limit = limit; } - public MappedFileInputStream(final ResizeableMappedFile raf, final long pos) throws IOException { - this(raf, pos, raf.length()); - } - @Override public int available() { @@ -67,7 +67,7 @@ public class MappedFileInputStream extends InputStream { } @Override - public int read( @NotNull byte[] b, int offset, int length ) throws IOException + public int read(@NotNull byte[] b, int offset, int length ) throws IOException { //only allow a read of the amount available. if( length > available() )