Class ProgressReadableByteChannelWrapper

java.lang.Object
com.github.tadukoo.launcher.downloader.ProgressReadableByteChannelWrapper
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.Channel, java.nio.channels.ReadableByteChannel

public class ProgressReadableByteChannelWrapper
extends java.lang.Object
implements java.nio.channels.ReadableByteChannel
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.nio.channels.ReadableByteChannel byteChannel  
    private long expectedSize  
    private long readSoFar  
  • Constructor Summary

    Constructors
    Constructor Description
    ProgressReadableByteChannelWrapper​(java.nio.channels.ReadableByteChannel byteChannel, long expectedSize)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    boolean isOpen()  
    int read​(java.nio.ByteBuffer bb)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • byteChannel

      private final java.nio.channels.ReadableByteChannel byteChannel
    • expectedSize

      private final long expectedSize
    • readSoFar

      private long readSoFar
  • Constructor Details

    • ProgressReadableByteChannelWrapper

      public ProgressReadableByteChannelWrapper​(java.nio.channels.ReadableByteChannel byteChannel, long expectedSize)
  • Method Details

    • 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
    • read

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