Class ElfFileChannel

  • All Implemented Interfaces:
    ElfByteChannel, java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.ReadableByteChannel, java.nio.channels.WritableByteChannel

    public class ElfFileChannel
    extends java.lang.Object
    implements ElfByteChannel
    • Constructor Summary

      Constructors 
      Constructor Description
      ElfFileChannel​(java.io.File file)  
    • Method Summary

      Modifier and Type Method Description
      void close()  
      boolean isOpen()  
      void openChannel()  
      long position()  
      ElfByteChannel position​(long newPosition)  
      int read​(java.nio.ByteBuffer dst)  
      int read​(java.nio.ByteBuffer dst, long position)  
      long size()  
      ElfByteChannel truncate​(long size)  
      int write​(java.nio.ByteBuffer src)  
      • Methods inherited from class java.lang.Object

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

      • ElfFileChannel

        public ElfFileChannel​(java.io.File file)
                       throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • openChannel

        public void openChannel()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • position

        public long position()
                      throws java.io.IOException
        Specified by:
        position in interface ElfByteChannel
        Throws:
        java.io.IOException
      • read

        public int read​(java.nio.ByteBuffer dst)
                 throws java.io.IOException
        Specified by:
        read in interface ElfByteChannel
        Specified by:
        read in interface java.nio.channels.ReadableByteChannel
        Throws:
        java.io.IOException
      • read

        public int read​(java.nio.ByteBuffer dst,
                        long position)
                 throws java.io.IOException
        Specified by:
        read in interface ElfByteChannel
        Throws:
        java.io.IOException
      • size

        public long size()
                  throws java.io.IOException
        Specified by:
        size in interface ElfByteChannel
        Throws:
        java.io.IOException
      • write

        public int write​(java.nio.ByteBuffer src)
                  throws java.io.IOException
        Specified by:
        write in interface ElfByteChannel
        Specified by:
        write in interface java.nio.channels.WritableByteChannel
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface java.nio.channels.Channel