[jcifs] skip(long) implementation in SmbFileInputStream

Bas Leijdekkers basleijdekkers at hotmail.com
Sun Sep 15 04:53:19 EST 2002


Hi,

I think it would be nice if the method skip(long) was implemented in
jcifs.smb.SmbFileInputStream. The default implementation of
java.io.InputStream just calls read(byte[], int, int) and throws away the
results. A bit of time and bandwidth can be saved by implementing a more
efficient version. My suggestion:

public long skip(long n) throws IOException {
  n = Math.min(file.length() - fp, n);
  fp += n;
  return n;
}

Best regards,
Bas




More information about the jcifs mailing list