快速业务通道

喘JAVA糞?産喝謹?殻涙怦毘響函垓殻猟周 - 園殻秘壇利

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-15
private static final int MAX_WRITER = 8;       private static long file_pointer;       private static int read_pos;       private static int fill_bytes;       private static byte[] buf;      //揖扮匆恬響亟揖化 迄:buf.wait()/buf.notify()       private static int[] buf_bytes;       private static int buf_index;       private static int alloc_pos;       private static URL url = null;       private static boolean isalive = true;       private static int writer_count;       private static int await_count;       private long file_length;       private long frame_bytes;              public BuffRandAcceURL(String sURL) throws Exception {           this(sURL,MAX_WRITER);       }              public BuffRandAcceURL(String sURL, int download_threads) throws Exception {           buf = new byte[BUF_LENGTH];           buf_bytes = new int[UNIT_COUNT];           url = new URL(sURL);                      //幹秀?殻參呟化圭塀盾裂ID3           new TagThread(url);                      //嬉咫輝念猟周兆           try {               String s = URLDecoder.decode(sURL, "GBK");               System.out.println("start>> " + s.substring(s.lastIndexOf("/") + 1));               s = null;           } catch (Exception e) {               System.out.println("start>> " + sURL);            }                      //幹秀"亟"?殻           for(int i = 0; i < download_threads; i++)               new Writer(this, url, buf, i+1);           frame_bytes = file_length = HttpReader.getContentLength();           if(file_length == 0) {               Header.strLastErr = "銭俊URL竃危?嶷編 " + HttpReader.MAX_RETRY + " 肝朔慧虹。";               throw new Exception("retry " + HttpReader.MAX_RETRY);           }           writer_count = download_threads;                      //産喝           try_cache();                      //柳狛ID3 v2           MP3Tag mP3Tag = new MP3Tag();           int v2_size = mP3Tag.checkID3V2(buf,0);           if (v2_size > 0) {               frame_bytes -= v2_size;               //seek(v2_size):               fill_bytes -= v2_size;               file_pointer = v2_size;               read_pos = v2_size;               read_pos &= BUF_LENGTH_MASK;               int units = v2_size >> UNIT_LENGTH_BITS;                for(int i = 0; i < units; i++) {         

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号