Class ReadableByteChannelDecorator

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Channel, ReadableByteChannel

    public class ReadableByteChannelDecorator
    extends Object
    implements ReadableByteChannel
    A ReadableByteChannel that delegates all calls to the underlying ReadableByteChannel but for close() it also calls ShapefileFiles.unlock method to release the lock on the URL.
    Author:
    jesse
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      boolean isOpen()  
      int read​(ByteBuffer dst)  
      • Methods inherited from class Object

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

      • ReadableByteChannelDecorator

        public ReadableByteChannelDecorator​(ReadableByteChannel newChannel,
                                            ShpFiles shapefileFiles,
                                            URL url,
                                            FileReader requestor)
    • Method Detail

      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Channel
        Specified by:
        close in interface Closeable
        Throws:
        IOException
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface Channel
      • read

        public int read​(ByteBuffer dst)
                 throws IOException
        Specified by:
        read in interface ReadableByteChannel
        Throws:
        IOException