Skip to content

Commit 57d9b83

Browse files
committed
checkstyle
1 parent 180062d commit 57d9b83

File tree

1 file changed

+5
-1
lines changed
  • net.lecousin.core/src/main/java/net/lecousin/framework/io

1 file changed

+5
-1
lines changed

net.lecousin.core/src/main/java/net/lecousin/framework/io/IOUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ public static long skipSyncByReading(IO.Readable io, long n) throws IOException
387387
* This must be used only if the synchronous skip is using only CPU.
388388
*/
389389
public static AsyncWork<Long,IOException> skipAsyncUsingSync(IO.Readable io, long n, RunnableWithParameter<Pair<Long,IOException>> ondone) {
390-
// TODO this should be skipAsyncUsingSync, then we should implement a real skipAsync
391390
Task<Long,IOException> task = new Task.Cpu<Long,IOException>("Skipping bytes", io.getPriority(), ondone) {
392391
@Override
393392
public Long run() throws IOException {
@@ -399,6 +398,9 @@ public Long run() throws IOException {
399398
return task.getSynch();
400399
}
401400

401+
/**
402+
* Implement an asynchronous skip using readAsync.
403+
*/
402404
public static AsyncWork<Long, IOException> skipAsyncByReading(IO.Readable io, long n, RunnableWithParameter<Pair<Long,IOException>> ondone) {
403405
if (n <= 0) {
404406
if (ondone != null) ondone.run(new Pair<>(Long.valueOf(0), null));
@@ -427,10 +429,12 @@ public void ready(Integer nb) {
427429
b.limit((int)(n - done.get()));
428430
io.readAsync(b).listenInline(this);
429431
}
432+
430433
@Override
431434
public void error(IOException error) {
432435
result.error(error);
433436
}
437+
434438
@Override
435439
public void cancelled(CancelException event) {
436440
result.cancel(event);

0 commit comments

Comments
 (0)