In this tutorial, we will discuss the use of skip() method of CheckedInputStream class. The CheckedInputStream class creates a input stream which maintains checksum at reading time and calculate checksum value.The CheckedInputStream class available in java.util.zip package. The skip() method is used to skip n bytes on associated input stream.
In the given Example, we
will explain how to use skip() method of CheckedInputStream class.
The CheckedInputStream class creates a input stream which maintains
checksum at reading time and calculate checksum value. The File class
creates an instance of file. The Length() method of File class returns
length of file. The read() method of CheckedOutputStream class
read a bytes from input stream.
The java.util.zip.CheckedInputStream class extends java.util.zip.FilterOutputStream class. It provid following method:
| Return Type | Method | Description |
| long | skip() | The skip() method skip given number of bytes of input stream. |
| void | read() | The read() method read a byte from input stream. |
import java.io.File;
|
| C:\>java CheckSkip Content of file before skiping : roseindia Content of file after skiping : rondia |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.