Пример #1
0
 public void close() throws IOException {
   if (channel != null) {
     channel.close();
   }
   if (client != null) {
     client.replay = null;
     client.close();
   }
 }
Пример #2
0
 public void nextFrame() throws IOException {
   if (!client.writeBusy()) {
     int nextPos = buffer.position();
     nextPos = Math.min(nextPos + frameSize, fileSize);
     buffer.limit(nextPos);
     client.write(buffer, false);
     if (nextPos >= fileSize) {
       this.close();
     }
   }
 }