Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.io

Class FilterReader

java.lang.Object
|
+--java.io.Reader
   |
   +--java.io.FilterReader


public abstract class FilterReader

extends Reader

This is the common superclass of all standard classes that filter input. It acts as a layer on top of an underlying Reader and simply redirects calls made to it to the subordinate Reader instead. Subclasses of this class perform additional filtering functions in addition to simply redirecting the call.

When creating a subclass of FilterReader, override the appropriate methods to implement the desired filtering. However, note that the read(char[]) method does not need to be overridden as this class redirects calls to that method to read(yte[], int, int) instead of to the subordinate Reader} read(yte[]) method.

Authors:

Field Summary

java.io.Readerin

This is the subordinate Reader to which method calls are redirected

Constructor Summary

FilterReader(java.io.Reader in)

Create a FilterReader with the specified subordinate Reader.

Method Summary

voidclose()

This method closes the stream by calling the close() method of the underlying stream.
voidmark(int readlimit)

Calls the in.mark(int) method.
booleanmarkSupported()

Calls the in.markSupported() method.
intread()

Calls the in.read() method
intread(char[] buf, int offset, int len)

Calls the in.read(char[], int, int) method.
booleanready()

Calls the in.read() method.
voidreset()

Calls the in.reset() method.
longskip(long num_chars)

Calls the in.skip(long) method

Field Details

in

protected Reader in

This is the subordinate Reader to which method calls are redirected


Constructor Details

FilterReader

protected FilterReader(java.io.Reader in)

Create a FilterReader with the specified subordinate Reader. The lock of the new FilterReader will be set to in.lock.

Parameters:


Method Details

close

public void close()

This method closes the stream by calling the close() method of the underlying stream.

Throws:


mark

public void mark(int readlimit)

Calls the in.mark(int) method.

Parameters:

Throws:


markSupported

public boolean markSupported()

Calls the in.markSupported() method.

Returns:


read

public int read()

Calls the in.read() method

Returns:

Throws:


read

public int read(char[] buf, int offset, int len)

Calls the in.read(char[], int, int) method.

Parameters:

Returns:

Throws:


ready

public boolean ready()

Calls the in.read() method.

Returns:

Throws:


reset

public void reset()

Calls the in.reset() method.

Throws:


skip

public long skip(long num_chars)

Calls the in.skip(long) method

Parameters:

Returns:

Throws: