Android examples for File Input Output:InputStream
skip when reading Stream
import android.support.annotation.NonNull; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; public class Main{ public static boolean skip(@NonNull InputStream stream, int count, String tag) {/*w w w .ja v a2 s.c o m*/ int length = 0; long skip; if (count > 0) { try { while (length < count) { skip = stream.skip(count - length); length += skip; } } catch (IOException e) { LogUtil.e(tag, "skip error at " + length + "/" + count + ", " + e.getMessage()); } } return length == count; } }