Revision | 8740bde4e642dc51c2b9b8d77345c09e3fe7d175 (tree) |
---|---|
Zeit | 2022-04-16 15:00:32 |
Autor | Hiroshi Miura <miurahr@linu...> |
Commiter | Hiroshi Miura |
Checkstyle
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@@ -35,17 +35,21 @@ import java.io.RandomAccessFile; | ||
35 | 35 | */ |
36 | 36 | public class RandomAccessInputStream extends InputStream { |
37 | 37 | private static final int DEFAULT_BUFSIZE = 4096; |
38 | - private RandomAccessFile in; | |
39 | - private byte inbuf[]; | |
38 | + private final RandomAccessFile in; | |
39 | + private final byte[] inbuf; | |
40 | + private final int bufsize; | |
40 | 41 | |
41 | 42 | private long currentpos = 0; |
42 | 43 | private long startpos = -1; |
43 | 44 | private long endpos = -1; |
44 | - | |
45 | 45 | private long mark = 0; |
46 | 46 | |
47 | - private int bufsize; | |
48 | 47 | |
48 | + /** | |
49 | + * Constructor of RandomAccessInputStream, accept RandomAccessFile and buffer size. | |
50 | + * @param inFile RandomAccessFile file. | |
51 | + * @param bufsize buffer size. | |
52 | + */ | |
49 | 53 | public RandomAccessInputStream(final RandomAccessFile inFile, final int bufsize) { |
50 | 54 | this.in = inFile; |
51 | 55 | this.bufsize = bufsize; |
@@ -72,6 +76,9 @@ public class RandomAccessInputStream extends InputStream { | ||
72 | 76 | this(new RandomAccessFile(file, mode)); |
73 | 77 | } |
74 | 78 | |
79 | + /** | |
80 | + * {@inheritDoc} | |
81 | + */ | |
75 | 82 | @Override |
76 | 83 | public final int available() throws IOException { |
77 | 84 | long available = length() - position(); |
@@ -81,6 +88,9 @@ public class RandomAccessInputStream extends InputStream { | ||
81 | 88 | return (int) available; |
82 | 89 | } |
83 | 90 | |
91 | + /** | |
92 | + * {@inheritDoc} | |
93 | + */ | |
84 | 94 | @Override |
85 | 95 | public final void close() throws IOException { |
86 | 96 | in.close(); |