the number of bytes read from the stream, or -1 if no bytes were read from the stream because the end of the stream had been reached

Throws:

java.lang.NullPointerException - if the passed array is null

java.lang.IndexOutOfBoundsException - if of or cb is negative, or of+cb is greater than the length of the ab

java.io.IOException - if an I/O error occurs

skip

public long skip(long cb)
throws java.io.IOException

Skips over up to the specified number of bytes of data from this InputStream. The number of bytes actually skipped over may be fewer than the number specified to skip, and may even be zero; this can be caused by an end-of-file condition, but can also occur even when there is data remaining in the InputStream. As a result, the caller should check the return value from this method, which indicates the actual number of bytes skipped.

available

public int available()
throws java.io.IOException

Returns the number of bytes that can be read (or skipped over) from this input stream without causing a blocking I/O condition to occur. This method reflects the assumed implementation of various buffering InputStreams, which can guarantee non-blocking reads up to the extent of their buffers, but beyond that the read operations will have to read from some underlying (and potentially blocking) source.

mark

public void mark(int cbReadLimit)

Marks the current read position in the InputStream in order to support the stream to be later "rewound" (using the reset() method) to the current position. The caller passes in the maximum number of bytes that it expects to read before calling the reset() method, thus indicating the upper bounds of the responsibility of the stream to be able to buffer what it has read in order to support this functionality.