private static void copyChannel(ReadableByteChannel inChannel,WritableByteChannel outChannel,long skip) throws IOException {
ByteBuffer dst = ByteBuffer.allocate(2048);
while (inChannel.read(dst) != -1) {
dst.flip();
while (dst.hasRemaining()) {
if(skip>0) {
int remaining = dst.remaining();
if(skip>remaining) {
dst.position(remaining);
skip = skip - remaining ;
}
}
outChannel.write(dst);
buffer.clear();
}
}
}