java - Nio bytebuffers (by channel) against IO BufferInputStream -


which of 2 best choice , in circumstance? there no sense in using file channel small file. besides that, pro , cons of 2 input/output means. lot in advance.

filechannel has many features missing in java.io: interruptible, can move position within file, can lock file, etc. , can faster old io, when uses direct byte buffers, here explanation bytebuffer api:

byte buffer either direct or non-direct. given direct byte buffer, java virtual machine make best effort perform native i/o operations directly upon it. is, attempt avoid copying buffer's content (or from) intermediate buffer before (or after) each invocation of 1 of underlying operating system's native i/o operations.  

if need none of above features go streams, you'll shorter code.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -