java - Why does netty example for HttpStaticFileServer use RandomAccessFile? -
is there specific reason netty httpstaticfileserverhandler example use randomaccessfile?
i think can demonstrate use of chunkedfile, requires randomaccessfile. , reason seems chunkedfile needs able file's length.
if not using https, need not use
chunkedfile. can choosefileinputstreaminstead ofrandomaccessfilereturnsfilechannel. cannot filelengthfileinputstreamrequired inputdefaultfileregion. think necessary userandomaccessfile.
that's correct. however, potentially file length other way; e.g. using file.length().
actually, doesn't make difference way filechannel , file length.
Comments
Post a Comment