Skip to content
Permalink
Browse files
Format tweaks.
  • Loading branch information
garydgregory committed Feb 8, 2022
1 parent 28ca390 commit 404f47f6d4d8c6e6c4dc6b3debe46760a30b282d
Showing 1 changed file with 11 additions and 10 deletions.
@@ -567,8 +567,10 @@ public int getHeaderPadCount(final Charset charset) {
* @since 1.18
*/
public int getHeaderPadCount(final long nameSize) {
if (this.alignmentBoundary == 0) { return 0; }
int size = this.headerSize + 1; // Name has terminating null
if (this.alignmentBoundary == 0) {
return 0;
}
int size = this.headerSize + 1; // Name has terminating null
if (name != null) {
size += nameSize;
}
@@ -584,11 +586,13 @@ public int getHeaderPadCount(final long nameSize) {
*
* @return the number of bytes needed to pad the data (0,1,2,3)
*/
public int getDataPadCount(){
if (this.alignmentBoundary == 0) { return 0; }
public int getDataPadCount() {
if (this.alignmentBoundary == 0) {
return 0;
}
final long size = this.filesize;
final int remain = (int) (size % this.alignmentBoundary);
if (remain > 0){
if (remain > 0) {
return this.alignmentBoundary - remain;
}
return 0;
@@ -630,9 +634,7 @@ public String getName() {
* @return Returns the number of links.
*/
public long getNumberOfLinks() {
return nlink == 0 ?
isDirectory() ? 2 : 1
: nlink;
return nlink == 0 ? isDirectory() ? 2 : 1 : nlink;
}

/**
@@ -826,8 +828,7 @@ public void setDeviceMin(final long min) {
*/
public void setSize(final long size) {
if (size < 0 || size > 0xFFFFFFFFL) {
throw new IllegalArgumentException("Invalid entry size <" + size
+ ">");
throw new IllegalArgumentException("Invalid entry size <" + size + ">");
}
this.filesize = size;
}

0 comments on commit 404f47f

Please sign in to comment.