Skip to content

Commit ce894b2

Browse files
committed
Javadoc: Add missing constructor Javadoc comments
1 parent ec7904b commit ce894b2

40 files changed

Lines changed: 316 additions & 41 deletions
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.commons.io;
21+
22+
import java.nio.ByteBuffer;
23+
import java.nio.ByteOrder;
24+
25+
/**
26+
* Manufactures {@link ByteBuffer} instances.
27+
*
28+
* @since 2.19.0
29+
*/
30+
public class ByteBuffers {
31+
32+
/**
33+
* Allocates a new byte buffer with little-endian byte order. The bytes of a multibyte value are ordered from least significant to most significant.
34+
* <p>
35+
* The new buffer's position is zero, the limit is its capacity, the mark is undefined, and each of element is initialized to zero. The new buffer has the
36+
* given backing {@code array}, and its {@link ByteBuffer#arrayOffset() array offset} is zero.
37+
* </p>
38+
*
39+
* @param array The array that will back the new byte buffer.
40+
* @return The new byte buffer.
41+
*/
42+
public static ByteBuffer littleEndian(final byte[] array) {
43+
return littleEndian(ByteBuffer.wrap(array));
44+
}
45+
46+
public static ByteBuffer littleEndian(final ByteBuffer allocate) {
47+
return allocate.order(ByteOrder.LITTLE_ENDIAN);
48+
}
49+
50+
/**
51+
* Allocates a new byte buffer with little-endian byte order. The bytes of a multibyte value are ordered from least significant to most significant.
52+
* <p>
53+
* The new buffer's position is zero, the limit is its capacity, the mark is undefined, and each of element is initialized to zero. The new buffer has a
54+
* {@link ByteBuffer#array() backing array}, and its {@link ByteBuffer#arrayOffset() array offset} is zero.
55+
* </p>
56+
*
57+
* @param capacity The new buffer's capacity, in bytes.
58+
* @return The new byte buffer.
59+
* @throws IllegalArgumentException If the <code>capacity</code> is negative.
60+
*/
61+
public static ByteBuffer littleEndian(final int capacity) {
62+
return littleEndian(ByteBuffer.allocate(capacity));
63+
}
64+
65+
}

src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ public static class Builder extends AbstractSupplier<WildcardFileFilter, Builder
9898
/** Whether the comparison is case-sensitive. */
9999
private IOCase ioCase = IOCase.SENSITIVE;
100100

101+
/**
102+
* Constructs a new builder of {@link WildcardFileFilter}.
103+
*/
104+
public Builder() {
105+
// empty
106+
}
107+
101108
@Override
102109
public WildcardFileFilter get() {
103110
return new WildcardFileFilter(ioCase, wildcards);

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ public abstract class AbstractInputStream extends InputStream {
3232
*/
3333
private boolean closed;
3434

35+
/**
36+
* Constructs a new instance for subclasses.
37+
*/
38+
public AbstractInputStream() {
39+
// empty
40+
}
41+
3542
/**
3643
* Checks if this instance is closed and throws an IOException if so.
3744
*

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ public class AutoCloseInputStream extends ProxyInputStream {
6262
// @formatter:on
6363
public static class Builder extends AbstractBuilder<AutoCloseInputStream, Builder> {
6464

65+
/**
66+
* Constructs a new builder of {@link AutoCloseInputStream}.
67+
*/
68+
public Builder() {
69+
// empty
70+
}
71+
6572
/**
6673
* Builds a new {@link AutoCloseInputStream}.
6774
* <p>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ static ByteOrderMark getDefaultByteOrderMark() {
141141

142142
private boolean include;
143143

144+
/**
145+
* Constructs a new builder of {@link BOMInputStream}.
146+
*/
147+
public Builder() {
148+
// empty
149+
}
150+
144151
/**
145152
* Builds a new {@link BOMInputStream}.
146153
* <p>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ public T setPropagateClose(final boolean propagateClose) {
242242
//@formatter:on
243243
public static class Builder extends AbstractBuilder<Builder> {
244244

245+
/**
246+
* Constructs a new builder of {@link BoundedInputStream}.
247+
*/
248+
public Builder() {
249+
// empty
250+
}
251+
245252
/**
246253
* Builds a new {@link BoundedInputStream}.
247254
* <p>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ public static class Builder extends AbstractStreamBuilder<BufferedFileChannelInp
7575

7676
private FileChannel fileChannel;
7777

78+
/**
79+
* Constructs a new builder of {@link BufferedFileChannelInputStream}.
80+
*/
81+
public Builder() {
82+
// empty
83+
}
84+
7885
/**
7986
* Builds a new {@link BufferedFileChannelInputStream}.
8087
* <p>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ public static class Builder extends AbstractStreamBuilder<CharSequenceInputStrea
8585

8686
private CharsetEncoder charsetEncoder = newEncoder(getCharset());
8787

88+
/**
89+
* Constructs a new builder of {@link CharSequenceInputStream}.
90+
*/
91+
public Builder() {
92+
// empty
93+
}
94+
8895
/**
8996
* Builds a new {@link CharSequenceInputStream}.
9097
* <p>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ public static class Builder extends AbstractBuilder<ChecksumInputStream, Builder
118118
*/
119119
private long expectedChecksumValue;
120120

121+
/**
122+
* Constructs a new builder of {@link ChecksumInputStream}.
123+
*/
124+
public Builder() {
125+
// empty
126+
}
127+
121128
/**
122129
* Builds a new {@link ChecksumInputStream}.
123130
* <p>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public final class MemoryMappedFileInputStream extends AbstractInputStream {
9292
public static class Builder extends AbstractStreamBuilder<MemoryMappedFileInputStream, Builder> {
9393

9494
/**
95-
* Constructs a new {@link Builder}.
95+
* Constructs a new builder of {@link MemoryMappedFileInputStream}.
9696
*/
9797
public Builder() {
9898
setBufferSizeDefault(DEFAULT_BUFFER_SIZE);

0 commit comments

Comments
 (0)