Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
a93de4c6
Commit
a93de4c6
authored
2 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Refactor: Unify filesize unit to bytes
parent
59072f60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java
+2
-3
...de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java
with
2 additions
and
3 deletions
+2
-3
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java
+
2
-
3
View file @
a93de4c6
...
...
@@ -11,7 +11,6 @@ public class CityGmlZipEntryFile implements AutoCloseable {
private
final
ZipEntry
zipEntry
;
private
final
CityGmlZipEntry
cgmlZipEntry
;
private
boolean
closed
=
false
;
private
static
final
long
MB
=
1024
*
1024L
;
public
CityGmlZipEntryFile
(
CityGmlZipEntry
entry
)
throws
IOException
{
CityGmlZipArchive
archive
=
entry
.
getArchive
();
...
...
@@ -38,9 +37,9 @@ public class CityGmlZipEntryFile implements AutoCloseable {
for
(
int
i
=
is
.
read
();
i
!=
-
1
;
i
=
is
.
read
())
{
bytes
++;
}
cgmlZipEntry
.
setFileSize
(
(
long
)
Math
.
ceil
((
double
)
bytes
/
MB
)
);
cgmlZipEntry
.
setFileSize
(
bytes
);
}
else
{
cgmlZipEntry
.
setFileSize
(
(
long
)
Math
.
ceil
((
double
)
zipEntry
.
getSize
()
/
MB
)
);
cgmlZipEntry
.
setFileSize
(
zipEntry
.
getSize
());
}
}
return
cgmlZipEntry
.
getFileSize
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment