Skip to content

Commit 2731c01

Browse files
authored
Merge pull request #2 from MrGPanPan/master
更新
2 parents 8d310a3 + 6d16b97 commit 2731c01

1,120 files changed

Lines changed: 63667 additions & 4198 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 271 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,271 @@
1-
2-
build/
3-
.idea/
4-
.gradle/
5-
*.class
6-
# Mobile Tools for Java (J2ME)
7-
.mtj.tmp/
8-
9-
# Package Files #
10-
*.jar
11-
*.war
12-
*.ear
13-
14-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15-
hs_err_pid*
16-
17-
#ide config
18-
.metadata
19-
.recommenders
20-
.idea/
21-
*.iml
22-
rebel.*
23-
.rebel.*
24-
25-
target
26-
*.DS_Store
27-
liuxin/.DS_Store
28-
liuxin/src/.DS_Store
29-
1+
2+
#################
3+
## Eclipse
4+
#################
5+
6+
*.pydevproject
7+
.project
8+
.metadata
9+
bin/
10+
tmp/
11+
*.tmp
12+
*.bak
13+
*.swp
14+
*~.nib
15+
local.properties
16+
.classpath
17+
.settings/
18+
.loadpath
19+
20+
# External tool builders
21+
.externalToolBuilders/
22+
23+
# Locally stored "Eclipse launch configurations"
24+
*.launch
25+
26+
# CDT-specific
27+
.cproject
28+
29+
# PDT-specific
30+
.buildpath
31+
32+
33+
#################
34+
## Visual Studio
35+
#################
36+
37+
## Ignore Visual Studio temporary files, build results, and
38+
## files generated by popular Visual Studio add-ons.
39+
40+
# User-specific files
41+
*.suo
42+
*.user
43+
*.sln.docstates
44+
45+
# Build results
46+
47+
[Dd]ebug/
48+
[Rr]elease/
49+
x64/
50+
build/
51+
[Bb]in/
52+
[Oo]bj/
53+
54+
# MSTest test Results
55+
[Tt]est[Rr]esult*/
56+
[Bb]uild[Ll]og.*
57+
58+
*_i.c
59+
*_p.c
60+
*.ilk
61+
*.meta
62+
*.obj
63+
*.pch
64+
*.pdb
65+
*.pgc
66+
*.pgd
67+
*.rsp
68+
*.sbr
69+
*.tlb
70+
*.tli
71+
*.tlh
72+
*.tmp
73+
*.tmp_proj
74+
*.log
75+
*.vspscc
76+
*.vssscc
77+
.builds
78+
*.pidb
79+
*.log
80+
*.scc
81+
82+
# Visual C++ cache files
83+
ipch/
84+
*.aps
85+
*.ncb
86+
*.opensdf
87+
*.sdf
88+
*.cachefile
89+
90+
# Visual Studio profiler
91+
*.psess
92+
*.vsp
93+
*.vspx
94+
95+
# Guidance Automation Toolkit
96+
*.gpState
97+
98+
# ReSharper is a .NET coding add-in
99+
_ReSharper*/
100+
*.[Rr]e[Ss]harper
101+
102+
# TeamCity is a build add-in
103+
_TeamCity*
104+
105+
# DotCover is a Code Coverage Tool
106+
*.dotCover
107+
108+
# NCrunch
109+
*.ncrunch*
110+
.*crunch*.local.xml
111+
112+
# Installshield output folder
113+
[Ee]xpress/
114+
115+
# DocProject is a documentation generator add-in
116+
DocProject/buildhelp/
117+
DocProject/Help/*.HxT
118+
DocProject/Help/*.HxC
119+
DocProject/Help/*.hhc
120+
DocProject/Help/*.hhk
121+
DocProject/Help/*.hhp
122+
DocProject/Help/Html2
123+
DocProject/Help/html
124+
125+
# Click-Once directory
126+
publish/
127+
128+
# Publish Web Output
129+
*.Publish.xml
130+
*.pubxml
131+
*.publishproj
132+
133+
# NuGet Packages Directory
134+
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
135+
#packages/
136+
137+
# Windows Azure Build Output
138+
csx
139+
*.build.csdef
140+
141+
# Windows Store app package directory
142+
AppPackages/
143+
144+
# Others
145+
sql/
146+
*.Cache
147+
ClientBin/
148+
[Ss]tyle[Cc]op.*
149+
~$*
150+
*~
151+
*.dbmdl
152+
*.[Pp]ublish.xml
153+
*.pfx
154+
*.publishsettings
155+
156+
# RIA/Silverlight projects
157+
Generated_Code/
158+
159+
# Backup & report files from converting an old project file to a newer
160+
# Visual Studio version. Backup files are not needed, because we have git ;-)
161+
_UpgradeReport_Files/
162+
Backup*/
163+
UpgradeLog*.XML
164+
UpgradeLog*.htm
165+
166+
# SQL Server files
167+
App_Data/*.mdf
168+
App_Data/*.ldf
169+
170+
#############
171+
## Windows detritus
172+
#############
173+
174+
# Windows image file caches
175+
Thumbs.db
176+
ehthumbs.db
177+
178+
# Folder config file
179+
Desktop.ini
180+
181+
# Recycle Bin used on file shares
182+
$RECYCLE.BIN/
183+
184+
# Mac crap
185+
.DS_Store
186+
187+
188+
#############
189+
## Python
190+
#############
191+
192+
*.py[cod]
193+
194+
# Packages
195+
*.egg
196+
*.egg-info
197+
dist/
198+
build/
199+
eggs/
200+
parts/
201+
var/
202+
sdist/
203+
develop-eggs/
204+
.installed.cfg
205+
206+
# Installer logs
207+
pip-log.txt
208+
209+
# Unit test / coverage reports
210+
.coverage
211+
.tox
212+
213+
#Translations
214+
*.mo
215+
216+
#Mr Developer
217+
.mr.developer.cfg
218+
.gitignore
219+
=======
220+
221+
222+
# Mobile Tools for Java (J2ME)
223+
.mtj.tmp/
224+
225+
# Package Files #
226+
*.jar
227+
*.war
228+
*.ear
229+
230+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
231+
hs_err_pid*
232+
233+
#ide config
234+
.metadata
235+
.recommenders
236+
237+
238+
*.xml
239+
*.iml
240+
.idea
241+
*.iml
242+
rebel.xml
243+
rebel-remote.xml
244+
245+
.classpath
246+
.project
247+
.setting
248+
.metadata
249+
250+
target
251+
*.class
252+
253+
log
254+
*.log
255+
tmp
256+
*.tmp
257+
258+
.metadata
259+
RemoteSystemsTempFiles
260+
.gitignore
261+
262+
.recommenders
263+
.idea/
264+
*.iml
265+
rebel.*
266+
.rebel.*
267+
268+
target
269+
*.DS_Store
270+
liuxin/.DS_Store
271+
liuxin/src/.DS_Store
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.github.FelixCJF.coding2017.coderising.download;
2+
3+
import java.io.File;
4+
import java.io.IOException;
5+
import java.io.RandomAccessFile;
6+
7+
import com.github.FelixCJF.coding2017.coderising.download.api.Connection;
8+
9+
public class DownloadThread extends Thread{
10+
11+
Connection conn;
12+
int startPos;
13+
int endPos;
14+
15+
public DownloadThread( Connection conn, int startPos, int endPos){
16+
17+
this.conn = conn;
18+
this.startPos = startPos;
19+
this.endPos = endPos;
20+
}
21+
public void run(){
22+
System.out.println("下载开始");
23+
try {
24+
byte[] buff = conn.read(startPos, endPos);
25+
//创建一个可随机写入文件
26+
RandomAccessFile randomAccessFile = new RandomAccessFile(new File("G:/"), "rwd");
27+
randomAccessFile.seek(startPos);
28+
randomAccessFile.write(buff, 0, buff.length);
29+
randomAccessFile.close();
30+
31+
System.out.println("下载结束");
32+
} catch (IOException e) {
33+
e.printStackTrace();
34+
}
35+
36+
}
37+
}

0 commit comments

Comments
 (0)