Java tutorial
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; public class Main { public static long skip(InputStream in, long len) throws IOException { if (len <= 0) { return 0; } long r; long t = 0; while ((r = in.skip(len - t)) != 0) { t += r; if (t == len) { break; } } return t; } }