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:
Dominik Stadler 2013-12-26 17:54:49 +00:00
parent 8f9d081f62
commit f8969e8d83

View File

@ -44,11 +44,6 @@ public final class MemoryPackagePart extends PackagePart {
*/
protected byte[] data;
/**
* Size of data.
*/
protected int length;
/**
* Constructor.
*
@ -104,12 +99,11 @@ public final class MemoryPackagePart extends PackagePart {
@Override
public long getSize() {
return length;
return data == null ? 0 : data.length;
}
public void clear() {
data = null;
length = 0;
}
@Override
@ -129,7 +123,6 @@ public final class MemoryPackagePart extends PackagePart {
// Save it
data = baos.toByteArray();
length = data.length;
// All done
return true;