Skip to content

Commit cf7a384

Browse files
committed
GFテスト,javadoc コメント修正
1 parent 1c2f20f commit cf7a384

File tree

12 files changed

+152
-78
lines changed

12 files changed

+152
-78
lines changed

pom.xml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>net.siisise</groupId>
55
<artifactId>softlib.module</artifactId>
6-
<version>1.1.17</version>
6+
<version>1.1.18-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<name>SoftLib</name>
99
<description>Java simple API Packet io, base64, etc...</description>
@@ -45,12 +45,12 @@
4545
<plugin>
4646
<groupId>org.apache.maven.plugins</groupId>
4747
<artifactId>maven-compiler-plugin</artifactId>
48-
<version>3.13.0</version>
48+
<version>3.14.0</version>
4949
</plugin>
5050
<plugin>
5151
<groupId>org.apache.maven.plugins</groupId>
5252
<artifactId>maven-javadoc-plugin</artifactId>
53-
<version>3.10.0</version>
53+
<version>3.11.2</version>
5454
<executions>
5555
<execution>
5656
<id>attach-javadocs</id>
@@ -64,7 +64,7 @@
6464
<plugin>
6565
<groupId>org.apache.maven.plugins</groupId>
6666
<artifactId>maven-gpg-plugin</artifactId>
67-
<version>3.2.5</version>
67+
<version>3.2.8</version>
6868
<executions>
6969
<execution>
7070
<id>sign-artifacts</id>
@@ -92,31 +92,19 @@
9292
<dependency>
9393
<groupId>org.junit.jupiter</groupId>
9494
<artifactId>junit-jupiter-api</artifactId>
95-
<version>[5.12.0,)</version>
95+
<version>[5.13.0,5.99.99)</version>
9696
<scope>test</scope>
9797
</dependency>
9898
<dependency>
9999
<groupId>org.junit.jupiter</groupId>
100100
<artifactId>junit-jupiter-params</artifactId>
101-
<version>[5.12.0,)</version>
101+
<version>[5.13.0,5.99.99)</version>
102102
<scope>test</scope>
103103
</dependency>
104104
<dependency>
105105
<groupId>org.junit.jupiter</groupId>
106106
<artifactId>junit-jupiter-engine</artifactId>
107-
<version>[5.12.0,)</version>
108-
<scope>test</scope>
109-
</dependency>
110-
<dependency>
111-
<groupId>junit</groupId>
112-
<artifactId>junit</artifactId>
113-
<version>4.13.2</version>
114-
<scope>test</scope>
115-
</dependency>
116-
<dependency>
117-
<groupId>org.hamcrest</groupId>
118-
<artifactId>hamcrest-core</artifactId>
119-
<version>1.3</version>
107+
<version>[5.13.0,5.99.99)</version>
120108
<scope>test</scope>
121109
</dependency>
122110
</dependencies>

src/main/java/net/siisise/io/ArrayOutputStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public ArrayOutputStream(byte[] data) {
4848

4949
/**
5050
* 配列の特定位置からストリーム出力先にする。
51-
* @param data
52-
* @param offset
51+
* @param data ソース配列
52+
* @param offset 位置
5353
*/
5454
public ArrayOutputStream(byte[] data, int offset) {
5555
buff = data;

src/main/java/net/siisise/io/IndexOutput.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@
2121
public interface IndexOutput {
2222

2323
/**
24-
* 上書き.
25-
* @param index
26-
* @param d
24+
* overwrite 上書き.
25+
* @param index 位置
26+
* @param d データ
2727
*/
2828
void put(long index, byte d);
29+
/**
30+
* overwrite 上書き.
31+
* @param index 位置
32+
* @param d データ列
33+
*/
2934
void put(long index, byte[] d);
3035
void put(long index, byte[] d, int offset, int length);
3136
}

src/main/java/net/siisise/io/Input.java

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,38 @@ default long read(Output dst) {
8383
return dst.write(this);
8484
}
8585

86+
/**
87+
* 1バイト読み.
88+
* @return 1バイトデータ
89+
*/
8690
byte get();
8791

92+
/**
93+
* 特定サイズ取得.
94+
* @param b 出力先
95+
* @return 取得サイズ
96+
*/
8897
default long get(byte[] b) {
8998
return get(b, 0, b.length);
9099
}
91100

101+
/**
102+
* 配列の途中にデータ取得.
103+
* lengthがsizeより大きい場合はException
104+
* @param b 配列
105+
* @param offset 位置
106+
* @param length サイズ
107+
* @return 取得サイズ
108+
*/
92109
long get(byte[] b, int offset, int length);
93110

111+
/**
112+
* ここからoutにデータ複製または移動.
113+
* outは固定サイズ、または可変サイズ
114+
* 固定サイズの場合は上限まで読み込む.
115+
* @param out 出力先
116+
* @return
117+
*/
94118
default long get(Output out) {
95119
if (out instanceof OverBlock && ((OverBlock) out).hasArray()) {
96120
ByteBlock o = (ByteBlock) out;
@@ -152,8 +176,8 @@ default int read(ByteBuffer dst) {
152176
* サイズが読み込めるかどうか.
153177
* length だと細かいデータのとき遅いかも.
154178
*
155-
* @param size
156-
* @return
179+
* @param size 読み込み予定サイズ
180+
* @return size以上のデータの有無
157181
*/
158182
default boolean readable(long size) {
159183
return length() >= size;
@@ -215,6 +239,13 @@ public byte get() {
215239
return (byte) b[0];
216240
}
217241

242+
/**
243+
* 部分読み込み.
244+
* @param b 読み込み先
245+
* @param offset 位置
246+
* @param length サイズ
247+
* @return 取得サイズ
248+
*/
218249
@Override
219250
public long get(byte[] b, int offset, int length) {
220251
int len = size();

src/main/java/net/siisise/io/NetReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public class NetReader extends FilterReader {
3333
private final static char LF = '\n';
3434

3535
/**
36-
*
37-
* @param r
36+
* Readerつなぎ.
37+
* @param r 読み出し元
3838
*/
3939
public NetReader(Reader r) {
4040
super(r);
@@ -43,7 +43,7 @@ public NetReader(Reader r) {
4343
/**
4444
* 不正な文字コードが混入していないかUnicodeに変換してから一応チェック
4545
*
46-
* @return
46+
* @return 1行
4747
* @throws java.io.IOException
4848
*/
4949
public String readLine() throws IOException {

src/main/java/net/siisise/io/Output.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public interface Output {
8080
*
8181
* @param pac データ
8282
* @param length pac data length
83-
* @return
83+
* @return 移動サイズ
8484
*/
8585
long write(Input pac, long length);
8686

@@ -179,7 +179,7 @@ public void dwrite(byte[] d) {
179179
}
180180

181181
/**
182-
*
182+
* データの移動.
183183
* @param src 入力元
184184
* @return データ移動したサイズ
185185
*/
@@ -188,6 +188,12 @@ public long write(Input src) {
188188
return Output.write(this, src, src.length());
189189
}
190190

191+
/**
192+
* データの移動.
193+
* @param pac 移動元
194+
* @param length サイズ
195+
* @return 移動したサイズ
196+
*/
191197
@Override
192198
public long write(Input pac, long length) {
193199
return Output.write(this, pac, length);

src/main/java/net/siisise/io/PacketA.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public int read(byte[] b, int offset, int length) {
176176
* @param b 入れ物
177177
* @param offset b offset
178178
* @param length b length
179-
* @return
179+
* @return 読み込めた長さ
180180
*/
181181
@Override
182182
public int backRead(byte[] b, int offset, int length) {
@@ -289,12 +289,22 @@ public void write(byte[] src, int offset, int length) {
289289
offset += d.length;
290290
}
291291
}
292-
292+
293+
/**
294+
* 直書き.
295+
* @param d データ領域
296+
*/
293297
@Override
294298
public void dwrite(byte[] d) {
295299
nullPack.addPrev(d);
296300
}
297301

302+
/**
303+
* 逆書き.
304+
* @param src 元データ
305+
* @param offset 位置
306+
* @param length データ長さ
307+
*/
298308
@Override
299309
public void backWrite(byte[] src, int offset, int length) {
300310
PacketIn nn = nullPack.next;
@@ -320,11 +330,19 @@ public void backWrite(byte[] src, int offset, int length) {
320330
}
321331
}
322332

333+
/**
334+
* 直逆書き.
335+
* @param d データ領域
336+
*/
323337
@Override
324338
public void dbackWrite(byte[] d) {
325339
nullPack.next.addPrev(d);
326340
}
327341

342+
/**
343+
* read方向の長さ.
344+
* @return 残りサイズ
345+
*/
328346
@Override
329347
public long length() {
330348
long length = 0;
@@ -335,7 +353,12 @@ public long length() {
335353
}
336354
return length;
337355
}
338-
356+
357+
/**
358+
* 読み込み可能サイズの確認.
359+
* @param size サイズ
360+
* @return 可否
361+
*/
339362
@Override
340363
public boolean readable(long size) {
341364
PacketIn pc = nullPack.next;
@@ -454,7 +477,7 @@ public long skip(long length) {
454477
/**
455478
* backSkip 戻る
456479
* @param length 長さ
457-
* @return
480+
* @return 戻れた長さ
458481
*/
459482
@Override
460483
public long back(long length) {
@@ -468,7 +491,7 @@ public long back(long length) {
468491
* @param b データ
469492
* @param offset データ位置
470493
* @param length 長さ
471-
* @return
494+
* @return 読み込めたデータ
472495
*/
473496
@Override
474497
public PacketA get(long index, byte[] b, int offset, int length) {

src/main/java/net/siisise/io/RevInput.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public interface RevInput {
4646
int backRead(byte[] buf, int offset, int length);
4747
int backRead(byte[] buf);
4848
/**
49-
* 逆読み
50-
* @param length
51-
* @return
49+
* 逆読み.
50+
* @param length 長さ
51+
* @return パケットで分割
5252
*/
5353
Packet backReadPacket(long length);
5454
/**

0 commit comments

Comments
 (0)