Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.memoire.re
Class REFilterInputStream  view REFilterInputStream download REFilterInputStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended bycom.memoire.re.REFilterInputStream
All Implemented Interfaces:
java.io.Closeable

public class REFilterInputStream
extends java.io.FilterInputStream

Replaces instances of a given RE with replacement text.

Since:
gnu.regexp 1.0.5

Field Summary
private  java.lang.String m_buffer
           
private  int m_bufpos
           
private  RE m_expr
           
private  int m_offset
           
private  java.lang.String m_replace
           
private  RECharIndexedInputStream m_stream
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
REFilterInputStream(java.io.InputStream f_stream, RE f_expr, java.lang.String f_replace)
          Creates an REFilterInputStream.
 
Method Summary
 boolean markSupported()
          Returns false.
 int read()
          Reads the next byte from the stream per the general contract of InputStream.read().
 int read(byte[] b)
          Reads from the stream into the provided array.
 int read(byte[] b, int off, int len)
          Reads from the stream into the provided array.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_expr

private RE m_expr

m_replace

private java.lang.String m_replace

m_buffer

private java.lang.String m_buffer

m_bufpos

private int m_bufpos

m_offset

private int m_offset

m_stream

private RECharIndexedInputStream m_stream
Constructor Detail

REFilterInputStream

public REFilterInputStream(java.io.InputStream f_stream,
                           RE f_expr,
                           java.lang.String f_replace)
Creates an REFilterInputStream. When reading from this stream, occurrences of patterns matching the supplied regular expression will be replaced with the supplied replacement text (the metacharacters $0 through $9 may be used to refer to the full match or subexpression matches.

Method Detail

read

public int read()
Reads the next byte from the stream per the general contract of InputStream.read(). Returns -1 on error or end of stream.


markSupported

public boolean markSupported()
Returns false. REFilterInputStream does not support mark() and reset() methods.


read

public int read(byte[] b,
                int off,
                int len)
Reads from the stream into the provided array.


read

public int read(byte[] b)
Reads from the stream into the provided array.