⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fileaccessi.java

📁 用java实现的断点续传源代码
💻 JAVA
字号:
  /*   
  **FileAccess.java   
  */   
  package   NetFox;   
  import   java.io.*;   
    
    
  public   class   FileAccessI   implements   Serializable{   
    
    
  RandomAccessFile   oSavedFile;   
  long   nPos;   
    
    
  public   FileAccessI()   throws   IOException   
  {   
  this("",0);   
  }   
    
    
  public   FileAccessI(String   sName,long   nPos)   throws   IOException   
  {   
  oSavedFile   =   new   RandomAccessFile(sName,"rw");   
  this.nPos   =   nPos;   
  oSavedFile.seek(nPos);   
  }   
    
    
  public   synchronized   int   write(byte[]   b,int   nStart,int   nLen)   
  {   
  int   n   =   -1;   
  try{   
  oSavedFile.write(b,nStart,nLen);   
  n   =   nLen;   
  }   
  catch(IOException   e)   
  {   
  e.printStackTrace   ();   
  }   
    
    
  return   n;   
  }   
    
    
  }   
    
    
 
  public   String   getSFilePath()   
  {   
  return   sFilePath;   
  }   
    
    
  public   void   setSFilePath(String   value)   
  {   
  sFilePath   =   value;   
  }   
    
    
  public   String   getSFileName()   
  {   
  return   sFileName;   
  }   
    
    
  public   void   setSFileName(String   value)   
  {   
  sFileName   =   value;   
  }   
    
    
  public   int   getNSplitter()   
  {   
  return   nSplitter;   
  }   
    
    
  public   void   setNSplitter(int   nCount)   
  {   
  nSplitter   =   nCount;   
  }   
  }   
    
  
  System.err.println(sMsg);   
  }   
  }   
    
    
  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -