Class FileSplit

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.GatheringByteChannel, java.nio.channels.InterruptibleChannel, java.nio.channels.ReadableByteChannel, java.nio.channels.ScatteringByteChannel, java.nio.channels.SeekableByteChannel, java.nio.channels.WritableByteChannel

    class FileSplit
    extends FileBaseDefault
    A file that may be split into multiple smaller files.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.nio.channels.FileChannel

        java.nio.channels.FileChannel.MapMode
    • Constructor Summary

      Constructors 
      Constructor Description
      FileSplit​(FilePathSplit file, java.lang.String mode, java.nio.channels.FileChannel[] list, long length, long maxLength)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void force​(boolean metaData)  
      private java.nio.channels.FileChannel getFileChannel​(long position)  
      void implCloseChannel()  
      protected void implTruncate​(long newLength)
      The truncate implementation.
      int read​(java.nio.ByteBuffer dst, long position)  
      long size()  
      java.lang.String toString()  
      java.nio.channels.FileLock tryLock​(long position, long size, boolean shared)  
      int write​(java.nio.ByteBuffer src, long position)  
      • Methods inherited from class java.nio.channels.FileChannel

        lock, open, open, read, tryLock, write
      • Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel

        begin, close, end, isOpen
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.nio.channels.Channel

        isOpen
    • Field Detail

      • mode

        private final java.lang.String mode
      • maxLength

        private final long maxLength
      • list

        private java.nio.channels.FileChannel[] list
      • length

        private volatile long length
    • Constructor Detail

      • FileSplit

        FileSplit​(FilePathSplit file,
                  java.lang.String mode,
                  java.nio.channels.FileChannel[] list,
                  long length,
                  long maxLength)
    • Method Detail

      • implCloseChannel

        public void implCloseChannel()
                              throws java.io.IOException
        Overrides:
        implCloseChannel in class FileBase
        Throws:
        java.io.IOException
      • size

        public long size()
        Specified by:
        size in interface java.nio.channels.SeekableByteChannel
        Specified by:
        size in class java.nio.channels.FileChannel
      • read

        public int read​(java.nio.ByteBuffer dst,
                        long position)
                 throws java.io.IOException
        Overrides:
        read in class FileBase
        Throws:
        java.io.IOException
      • getFileChannel

        private java.nio.channels.FileChannel getFileChannel​(long position)
                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • implTruncate

        protected void implTruncate​(long newLength)
                             throws java.io.IOException
        Description copied from class: FileBaseDefault
        The truncate implementation.
        Specified by:
        implTruncate in class FileBaseDefault
        Parameters:
        newLength - the new size
        Throws:
        java.io.IOException - on failure
      • force

        public void force​(boolean metaData)
                   throws java.io.IOException
        Overrides:
        force in class FileBase
        Throws:
        java.io.IOException
      • write

        public int write​(java.nio.ByteBuffer src,
                         long position)
                  throws java.io.IOException
        Overrides:
        write in class FileBase
        Throws:
        java.io.IOException
      • tryLock

        public java.nio.channels.FileLock tryLock​(long position,
                                                  long size,
                                                  boolean shared)
                                           throws java.io.IOException
        Overrides:
        tryLock in class FileBase
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object