• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JLayer wont abort the InputStream (from a HTTP Server)

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i have a http server which gives me some media files (mp3 etc.)
i use JLayer to play the media files which works fine
the big problem is that some files are really big and the Player class just wont stop downloading them when i hit the "stop" button
i have no idea what could going on...

JLayer uses a class called "Bitstream" which has a source field - this is a PushbackInputStream.
When it now goes to the source.close() line it just wont stop download the file (into the ram).

Can please someone help me how i can fix this?
 
olze oli
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when i say:
player.close(); it simply does nothing (but it calls close() on the PushbackInputStream).
When i call myUglyPlayThread.stop() it stops downloading but the thread locks :/
 
olze oli
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it was a problem with apache httpclient..., no not a problem, a feature
i had to cast the stream (i get the stream via httpget())
i thought its a normal InputStream, but its an EofSomethingStream which had an abort() method which does it now for me
furthermore i use AdvancedPlayer because i can implement what happens when the close method of the player has been called
 
reply
    Bookmark Topic Watch Topic
  • New Topic