Class YoutubePersistentHttpStream

java.lang.Object
java.io.InputStream
com.sedmelluq.discord.lavaplayer.tools.io.SeekableInputStream
com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream
dev.lavalink.youtube.track.YoutubePersistentHttpStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class YoutubePersistentHttpStream extends com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream
A persistent HTTP stream implementation that uses the range parameter instead of HTTP headers for specifying the start position at which to start reading on a new connection.
  • Field Summary

    Fields inherited from class com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream

    contentUrl, currentContent, position

    Fields inherited from class com.sedmelluq.discord.lavaplayer.tools.io.SeekableInputStream

    contentLength
  • Constructor Summary

    Constructors
    Constructor
    Description
    YoutubePersistentHttpStream(com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, URI contentUrl, long contentLength)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    protected URI
     
    protected int
    internalRead(byte[] b, int off, int len, boolean attemptReconnect)
     
    protected long
    internalSkip(long n, boolean attemptReconnect)
     
    protected boolean
     

    Methods inherited from class com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream

    available, checkStatusCode, close, connect, createContentInputStream, getCurrentResponse, getPosition, getTrackInfoProviders, markSupported, read, read, releaseConnection, reset, seekHard, skip

    Methods inherited from class com.sedmelluq.discord.lavaplayer.tools.io.SeekableInputStream

    getContentLength, getMaxSkipDistance, seek, skipFully

    Methods inherited from class java.lang.Object

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

    • YoutubePersistentHttpStream

      public YoutubePersistentHttpStream(com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, URI contentUrl, long contentLength)
      Parameters:
      httpInterface - The HTTP interface to use for requests
      contentUrl - The URL of the resource
      contentLength - The length of the resource in bytes
  • Method Details

    • getConnectUrl

      protected URI getConnectUrl()
      Overrides:
      getConnectUrl in class com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream
    • internalRead

      protected int internalRead(byte[] b, int off, int len, boolean attemptReconnect) throws IOException
      Overrides:
      internalRead in class com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream
      Throws:
      IOException
    • internalSkip

      protected long internalSkip(long n, boolean attemptReconnect) throws IOException
      Overrides:
      internalSkip in class com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream
      Throws:
      IOException
    • useHeadersForRange

      protected boolean useHeadersForRange()
      Overrides:
      useHeadersForRange in class com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream
    • canSeekHard

      public boolean canSeekHard()
      Overrides:
      canSeekHard in class com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream