]> source.dussan.org Git - poi.git/commitdiff
Remove unnecessary separate length, an array already has one
authorDominik Stadler <centic@apache.org>
Thu, 26 Dec 2013 17:54:49 +0000 (17:54 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 26 Dec 2013 17:54:49 +0000 (17:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1553522 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java

index b6c56949d4ce6b1b0744a369880f4109a6cb9336..f38d7a26d88e804557ad12dea84ece6796e091f4 100644 (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;