Package gnu.regexp

Class REFilterInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class REFilterInputStream
    extends java.io.FilterInputStream
    Deprecated.
    This class cannot properly handle all character encodings. For proper handling, use the REFilterReader class instead.
    Replaces instances of a given RE found within an InputStream with replacement text. The replacements are interpolated into the stream when a match is found.
    Author:
    Wes Biggs
    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      REFilterInputStream​(java.io.InputStream stream, RE expr, java.lang.String replace)
      Deprecated.
      Creates an REFilterInputStream.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean markSupported()
      Deprecated.
      Returns false.
      int read()
      Deprecated.
      Reads the next byte from the stream per the general contract of InputStream.read().
      int read​(byte[] b)
      Deprecated.
      Reads from the stream into the provided array.
      int read​(byte[] b, int off, int len)
      Deprecated.
      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.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • REFilterInputStream

        public REFilterInputStream​(java.io.InputStream stream,
                                   RE expr,
                                   java.lang.String replace)
        Deprecated.
        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).
        Parameters:
        stream - The InputStream to be filtered.
        expr - The regular expression to search for.
        replace - The text pattern to replace matches with.
    • Method Detail

      • read

        public int read()
        Deprecated.
        Reads the next byte from the stream per the general contract of InputStream.read(). Returns -1 on error or end of stream.
        Overrides:
        read in class java.io.FilterInputStream
      • markSupported

        public boolean markSupported()
        Deprecated.
        Returns false. REFilterInputStream does not support mark() and reset() methods.
        Overrides:
        markSupported in class java.io.FilterInputStream
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
        Deprecated.
        Reads from the stream into the provided array.
        Overrides:
        read in class java.io.FilterInputStream
      • read

        public int read​(byte[] b)
        Deprecated.
        Reads from the stream into the provided array.
        Overrides:
        read in class java.io.FilterInputStream