Skip to content

Commit 1f925d7

Browse files
committed
Javadoc warnings
1 parent cc1a994 commit 1f925d7

4 files changed

Lines changed: 23 additions & 11 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public void closed() throws IOException {}
7272

7373
/**
7474
* Called to indicate, that an error occurred on the underlying stream.
75+
* @param pException the exception to throw
7576
* @throws IOException if an i/o-error occurs
7677
*/
7778
public void error(final IOException pException) throws IOException { throw pException; }

src/main/java/org/apache/commons/io/input/buffer/CircularBufferInputStream.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ public CircularBufferInputStream(InputStream pIn, int pBufferSize) {
5353
/** Creates a new instance, which filters the given input stream, and
5454
* uses a reasonable default buffer size (8192).
5555
* @param pIn The input stream, which is being buffered.
56-
* @param pBufferSize The size of the {@link CircularByteBuffer}, which is
57-
* used internally.
5856
*/
5957
public CircularBufferInputStream(InputStream pIn) {
6058
this(pIn, 8192);

src/main/java/org/apache/commons/io/input/buffer/CircularByteBuffer.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class CircularByteBuffer {
3131

3232
/**
3333
* Creates a new instance with the given buffer size.
34+
* @param pSize the size of buffer to create
3435
*/
3536
public CircularByteBuffer(int pSize) {
3637
buffer = new byte[pSize];
@@ -128,9 +129,12 @@ public void add(byte pByte) {
128129
* {@code pBuffer}, {@code pOffset}, and {@code pLength}. No bytes are being
129130
* removed from the buffer. If the result is true, then the following invocations
130131
* of {@link #read()} are guaranteed to return exactly those bytes.
132+
* @param pBuffer the buffer to compare against
133+
* @param pOffset start offset
134+
* @param pLength length to compare
131135
* @return True, if the next invocations of {@link #read()} will return the
132136
* bytes at offsets {@code pOffset}+0, {@code pOffset}+1, ...,
133-
* @code{pOffset}+@code{pLength}-1 of byte array {@code pBuffer}.
137+
* {@code pOffset}+{@code pLength}-1 of byte array {@code pBuffer}.
134138
* @throws IllegalArgumentException Either of {@code pOffset}, or {@code pLength} is negative.
135139
* @throws NullPointerException The byte array {@code pBuffer} is null.
136140
*/
@@ -160,7 +164,10 @@ public boolean peek(byte[] pBuffer, int pOffset, int pLength) {
160164
/**
161165
* Adds the given bytes to the buffer. This is the same as invoking {@link #add(byte)}
162166
* for the bytes at offsets {@code pOffset}+0, {@code pOffset}+1, ...,
163-
* @code{pOffset}+@code{pLength}-1 of byte array {@code pBuffer}.
167+
* {@code pOffset}+{@code pLength}-1 of byte array {@code pBuffer}.
168+
* @param pBuffer the buffer to copy
169+
* @param pOffset start offset
170+
* @param pLength length to copy
164171
* @throws IllegalStateException The buffer doesn't have sufficient space. Use
165172
* {@link #getSpace()} to prevent this exception.
166173
* @throws IllegalArgumentException Either of {@code pOffset}, or {@code pLength} is negative.
@@ -191,6 +198,7 @@ public void add(byte[] pBuffer, int pOffset, int pLength) {
191198
* Same as {@link #hasSpace(int) hasSpace(1)}.
192199
* @see #hasSpace(int)
193200
* @see #getSpace()
201+
* @return true if there is space for a byte
194202
*/
195203
public boolean hasSpace() {
196204
return currentNumberOfBytes < buffer.length;
@@ -200,27 +208,32 @@ public boolean hasSpace() {
200208
* Returns, whether there is currently room for the given number of bytes in the buffer.
201209
* @see #hasSpace()
202210
* @see #getSpace()
211+
* @param pBytes the byte count
212+
* @return true if there is space for the given number of bytes
203213
*/
204214
public boolean hasSpace(int pBytes) {
205215
return currentNumberOfBytes+pBytes <= buffer.length;
206216
}
207217

208218
/**
209219
* Returns, whether the buffer is currently holding, at least, a single byte.
220+
* @return true if the buffer is not empty
210221
*/
211222
public boolean hasBytes() {
212223
return currentNumberOfBytes > 0;
213224
}
214225

215226
/**
216227
* Returns the number of bytes, that can currently be added to the buffer.
228+
* @return the number of bytes that can be added
217229
*/
218230
public int getSpace() {
219231
return buffer.length - currentNumberOfBytes;
220232
}
221233

222234
/**
223235
* Returns the number of bytes, that are currently present in the buffer.
236+
* @return the number of bytes
224237
*/
225238
public int getCurrentNumberOfBytes() {
226239
return currentNumberOfBytes;

src/main/java/org/apache/commons/io/input/buffer/PeekableInputStream.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public PeekableInputStream(InputStream pIn, int pBufferSize) {
3939
/** Creates a new instance, which filters the given input stream, and
4040
* uses a reasonable default buffer size (8192).
4141
* @param pIn The input stream, which is being buffered.
42-
* @param pBufferSize The size of the {@link CircularByteBuffer}, which is
43-
* used internally.
4442
*/
4543
public PeekableInputStream(InputStream pIn) {
4644
super(pIn);
@@ -50,8 +48,8 @@ public PeekableInputStream(InputStream pIn) {
5048
* Returns, whether the next bytes in the buffer are as given by
5149
* {@code pBuffer}. This is equivalent to {@link #peek(byte[],int,int)}
5250
* with {@code pOffset} == 0, and {@code pLength} == {@code pBuffer.length}
53-
* @param pBuffer
54-
* @return
51+
* @param pBuffer the buffer to compare against
52+
* @return true if the next bytes are as given
5553
* @throws IOException Refilling the buffer failed.
5654
*/
5755
public boolean peek(byte[] pBuffer) throws IOException {
@@ -69,9 +67,11 @@ public boolean peek(byte[] pBuffer) throws IOException {
6967
/**
7068
* Returns, whether the next bytes in the buffer are as given by
7169
* {@code pBuffer}, {code pOffset}, and {@code pLength}.
72-
* @param pBuffer
73-
* @return
74-
* @throws IOException
70+
* @param pBuffer the buffer to compare against
71+
* @param pOffset the start offset
72+
* @param pLength the length to compare
73+
* @return true if the next bytes in the buffer are as given
74+
* @throws IOException if there is a problem calling fillBuffer()
7575
*/
7676
public boolean peek(byte[] pBuffer, int pOffset, int pLength) throws IOException {
7777
Objects.requireNonNull(pBuffer, "Buffer");

0 commit comments

Comments
 (0)