Reading file chunk by chunk

前端 未结 3 1913
名媛妹妹
名媛妹妹 2020-12-02 00:50

I want to read a file piece by piece. The file is split up into several pieces which are stored on different types of media. What I currently do is call each seperate piece

3条回答
  •  温柔的废话
    2020-12-02 01:18

    what you want is source data line. This is perfect for when your data is too large to hold it in memory at once, so you can start playing it before you receive the entire file. Or if the file never ends.

    look at the tutorial for source data line here

    http://docs.oracle.com/javase/6/docs/api/java/io/FileInputStream.html#read

    I would use this FileInputSteam

提交回复
热议问题