Remove unnecessary separate length, an array already has one
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1553522 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8f9d081f62
commit
f8969e8d83
@ -44,11 +44,6 @@ public final class MemoryPackagePart extends PackagePart {
|
|||||||
*/
|
*/
|
||||||
protected byte[] data;
|
protected byte[] data;
|
||||||
|
|
||||||
/**
|
|
||||||
* Size of data.
|
|
||||||
*/
|
|
||||||
protected int length;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
@ -104,12 +99,11 @@ public final class MemoryPackagePart extends PackagePart {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getSize() {
|
public long getSize() {
|
||||||
return length;
|
return data == null ? 0 : data.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
data = null;
|
data = null;
|
||||||
length = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,7 +123,6 @@ public final class MemoryPackagePart extends PackagePart {
|
|||||||
|
|
||||||
// Save it
|
// Save it
|
||||||
data = baos.toByteArray();
|
data = baos.toByteArray();
|
||||||
length = data.length;
|
|
||||||
|
|
||||||
// All done
|
// All done
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user