transport io BufferedInputStream io BufferedOutputStream io InputStream io OutputStream io tfiletransport ttransport truncablebufferedinputstream bufferedinputstream trunc pos count truncablebufferedinputstream inputstream truncablebufferedinputstream inputstream buf_ nread_ navailable_ buf buf_ buf nread_ navailable_ getbuf buf_ getsize buf_.length setavailable sz nread_ navailable_ sz getremaining navailable_ nread_ emit buf offset ndesired ndesired ndesired getremaining ndesired getremaining ndesired ndesired system.arraycopy buf_ nread_ buf offset ndesired nread_ ndesired ndesired chunkstate default_chunk_size chunk_size_ default_chunk_size offset_ chunkstate chunkstate chunk_size chunk_size_ chunk_size skip offset_ seek offset offset_ offset getchunksize chunk_size_ getchunknum offset_ getremaining chunk_size_ offset_ chunk_size_ getoffset offset_ tailpolicy nowait wait_forever timeout_ retries_ tailpolicy timeout retries timeout_ timeout retries_ retries tailpolicy tailpolicy.nowait tseekablefile inputfile_ outputstream outputstream_ inputstream inputstream_ chunkstate cs readtimeout_ readonly_ tailpolicy gettailpolicy tailpolicy settailpolicy tailpolicy policy tailpolicy policy inputstream createinputstream ttransportexception inputstream inputstream_ truncablebufferedinputstream inputstream_ trunc inputstream_ truncablebufferedinputstream inputfile_.getinputstream iox system.err.println iox.getmessage ttransportexception iox.getmessage iox tailread inputstream buf len tailpolicy tp ttransportexception orig_len len retries len cnt is.read buf len cnt cnt len cnt retries cs.skip cnt cnt retries tp.retries_ tp.retries_ retries orig_len len tp.timeout_ thread.sleep tp.timeout_ interruptedexception ttransportexception cnt iox ttransportexception iox.getmessage iox orig_len len performrecovery ttransportexception numchunks getnumchunks curchunk cs.getchunknum curchunk numchunks-1 seektochunk curchunk readevent ttransportexception ebytes esize nread nrequested retry nrequested cs.getremaining nrequested nread tailread inputstream_ ebytes nrequested nread nrequested nread tailread inputstream_ ebytes nread esize i-- ebytes esize esize cs.getremaining ttransportexception esize currentevent_.getsize esize esize buf currentevent_.getbuf nread tailread inputstream_ buf esize nread esize currentevent_.setavailable esize isopen inputstream_ readonly_ outputstream_ ttransportexception isopen ttransportexception ttransportexception.already_open inputstream_ createinputstream cs chunkstate readonly_ outputstream_ bufferedoutputstream inputfile_.getoutputstream iox ttransportexception ttransportexception.not_open iox close inputfile_ inputfile_.close iox system.err.println iox.getmessage inputfile_ outputstream_ outputstream_.close iox system.err.println iox.getmessage outputstream_ tfiletransport path readonly inputfile_ tstandardfile path readonly_ readonly tfiletransport tseekablefile inputfile readonly inputfile_ inputfile readonly_ readonly readall buf len ttransportexception ret len ret read buf len-got ret ttransportexception ret ttransportexception ttransportexception.end_of_file ret read buf len ttransportexception isopen ttransportexception ttransportexception.not_open currentevent_.getremaining readevent nread currentevent_.emit buf len nread getnumchunks ttransportexception isopen ttransportexception ttransportexception.not_open len inputfile_.length len len iox ttransportexception iox.getmessage iox getcurchunk ttransportexception isopen ttransportexception ttransportexception.not_open cs.getchunknum seektochunk chunk ttransportexception isopen ttransportexception ttransportexception.not_open numchunks getnumchunks numchunks chunk chunk numchunks chunk chunk eofoffset seektoend chunk numchunks seektoend chunk chunk eofoffset inputfile_.length iox ttransportexception iox.getmessage iox chunk cs.getchunksize cs.getoffset inputfile_.seek chunk cs.getchunksize iox system.err.println iox.getmessage ttransportexception chunk iox.getmessage iox cs.seek chunk cs.getchunksize currentevent_.setavailable inputstream_ createinputstream seektoend tailpolicy settailpolicy tailpolicy.wait_forever cs.getoffset eofoffset readevent currentevent_.setavailable settailpolicy seektoend ttransportexception isopen ttransportexception ttransportexception.not_open seektochunk getnumchunks write buf len ttransportexception ttransportexception flush ttransportexception ttransportexception num_chunks args.length printusage args.length num_chunks integer.parseint system.err.println printusage tfiletransport tfiletransport t.getnumchunks num_chunks buf cnum r.nextint t.getnumchunks cnum t.seektochunk cnum t.read buf printusage system.err.println system.err.println