Consider adding a doc comment for PacketInputStream
11 super(buf);
12 }
13
14 public PacketInputStream(byte[] buf, int offset, int length) {15 super(buf, offset, length);16 }17
18 public synchronized byte readByte() throws IOException {
19 read(tmpBuffer, 0, 1);
Consider adding a doc comment for PacketInputStream
7
8 private byte[] tmpBuffer = new byte[8];
9
10 public PacketInputStream(byte[] buf) {11 super(buf);12 }13
14 public PacketInputStream(byte[] buf, int offset, int length) {
15 super(buf, offset, length);
Description
This constructor does not have any documentation.
Consider adding a documentation comment to explain its use.
While it may seem like the usage of a constructor is perfectly obvious, any consumers of your API may not be able to pick up on certain details.
Bad Practice
In the example below, it is difficult to understand what the arguments of this constructor for DataForwarder
signify.
class DataForwarder {
public DataForwarder(int nTypes, String... values) {
// ...
}
}
Recommended
Document the constructor and provide useful information about it or its parameters as required.
/**
* Initializes a DataForwarder with a set of types to filter by, along with their names.
*
* @param nTypes - The number of types to filter by.
* @param values - The input type names to filter by.
*/
public DataForwarder(int nTypes, String... values) {
// ...
}
Exceptions
If you feel this constructor does not require documentation, you can add a skipcq comment to this constructor.