The skip()
method
reads a specified number of bytes and throws them away.
public int skip(long n) throws IOException
An example:
case 171: // lookupswitch
pad = 3 - (position % 4);
dis.skip(pad);
defaultByte = dis.readInt();
int npairs = dis.readInt();
result = position + " lookupswitch " + defaultByte + " " + npairs;
for (int i = 0; i < npairs; i++) {
int newPosition = position + pad + 12 + i*8;
result += "\n" + newPosition + " "
+ dis.readInt() + " " + dis.readInt();
}
The complete program is included in Chapter 5 of my book, Java Secrets, IDG Books, 1997.)