Class MarkShieldInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class MarkShieldInputStream
    extends ProxyInputStream
    This is an alternative to ByteArrayInputStream which removes the synchronization overhead for non-concurrent access; as such this class is not thread-safe. Proxy stream that prevents the underlying input stream from being marked/reset.

    This class is typically used in cases where an input stream that supports marking needs to be passed to a component that wants to explicitly mark the stream, but it it is not desirable to allow marking of the stream.

    • Constructor Detail

      • MarkShieldInputStream

        public MarkShieldInputStream(InputStream in)
        Creates a proxy that shields the given input stream from being marked or rest.
        in - underlying input stream
    • Method Detail

      • mark

        public void mark(int readlimit)
        Description copied from class: ProxyInputStream
        Invokes the delegate's mark(int) method.
        mark in class  ProxyInputStream
        readlimit - read ahead limit
      • markSupported

        public boolean markSupported()
        Description copied from class: ProxyInputStream
        Invokes the delegate's markSupported() method.
        markSupported in class  ProxyInputStream
        true if mark is supported, otherwise false

Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.