Report the number of bytes required for serialization.

@return the size in bytes
507835
@Override
  public int serializedSizeInBytes() {
    int count = headerSize();
    // for each container, we store cardinality (16 bits), key (16 bits) and location offset (32
    // bits).
    for (int k = 0; k < this.size; ++k) {
      count += values[k].getArraySizeInBytes();
    }
    return count;
  }
501857
public int getSerializedSizeAsMessageSet() {
    int result = 0;
    for (final Map.Entry<Integer, Field> entry : fields.entrySet()) {
      result += entry.getValue().getSerializedSizeAsMessageSetExtension(
        entry.getKey());
    }
    return result;
  }
1226979
protected long getSerializedBytesLength()
                    throws ObjectManagerException
    {
        final String methodName = "getSerializedBytesLength";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        methodName);

        // Mimic the action of getSerializedBytes but don't actuallly create the bytes.
        // Used to esimate the length of future attempts to serialize the Object.
        class DummyOutputStream extends java.io.OutputStream {

            public void write(int b)
                            throws java.io.IOException
            {}

        } // class DummyOutputStream.
        java.io.DataOutputStream dataOutputStream = new java.io.DataOutputStream(new DummyOutputStream());

        try {
            if (this instanceof SimplifiedSerialization) {
                int signature = getSignature();
                dataOutputStream.writeInt(signature);
                if (signature == SimplifiedSerialization.signature_Generic) {
                    dataOutputStream.writeUTF(getClass().getName());
                } // if (signature == SimplifiedSerialization.signature_Generic).

                ((SimplifiedSerialization) this).writeObject(dataOutputStream);

            } else {
                dataOutputStream.writeInt(SimplifiedSerialization.signature_DefaultSerialization);

                java.io.ObjectOutputStream objectOutputStream = new java.io.ObjectOutputStream(dataOutputStream);
                objectOutputStream.writeObject(this);
                objectOutputStream.close();
            }
        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:707:1.34");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           methodName,
                           exception);
            throw new PermanentIOException(this,
                                           exception);
        } // catch.

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(cclass,
                       methodName,
                       new Object[] { dataOutputStream,
                                     new Long(dataOutputStream.size()) });
        return dataOutputStream.size();
    }
1166799
public int size() {
        int count = 0;

        for (int i = 0, size = mScrapLength.size(); i < size; i++) {
            int val = mScrapLength.valueAt(i);
            count += val;
        }

        return count;
    }
113414
public int byteSize() throws IonException
    {
        // TODO this is horrible, users will end up encoding multiple times!
        ReverseBinaryEncoder encoder =
            new ReverseBinaryEncoder(REVERSE_BINARY_ENCODER_INITIAL_SIZE);
        encoder.serialize(this);
        return encoder.byteSize();
    }
506749
public int getDataSize() {
        // Data size is given by lvs
        int size = 0;
        for(int i=0; i<numLVs; i++) {
            size += IOUtils.toInt(lvs[i]);
        }
        return size;
    }
1276911
public int size() {
        int n = 0;
        int count = getRangeCount();
        for (int i = 0; i < count; ++i) {
            n += getRangeEnd(i) - getRangeStart(i) + 1;
        }
        return n + strings.size();
    }
596027
public static int size(Object obj) {
		if (obj == null) {
			return 0;
		}
		ByteArrayOutputStream buf = new ByteArrayOutputStream(4096);
		try {
			ObjectOutputStream out = new ObjectOutputStream(buf);
			out.writeObject(obj);
			out.flush();
			buf.close();
		} catch (IOException e) {
			return 0;
		}

		return buf.size();
	}
571883
@Override
    public int size() {
        Node h = putStack.get();
        int putStackSize = h == null ? 0 : h.size;
        return putStackSize + takeStackSize.get();
    }
1330589
public byte[] toByteArray() {
    try {
      final byte[] result = new byte[getSerializedSize()];
      final CodedOutputStream output = CodedOutputStream.newInstance(result);
      writeTo(output);
      output.checkNoSpaceLeft();
      return result;
    } catch (final IOException e) {
      throw new RuntimeException(
        "Serializing to a byte array threw an IOException " +
        "(should never happen).", e);
    }
  }
821341
@Override
    public int smallByteSize() {
        int bound = byteSize();
        ByteBuffer buf = ByteBuffer.allocate(bound);
        asSmallBytes(buf);
        return buf.position();
    }
246400
@Nonnegative
  public long getSize ()
  {
    if (m_nSize >= 0)
      return m_nSize;
    if (m_aCachedContent != null)
      return m_aCachedContent.length;
    if (m_aDFOS.isInMemory ())
      return m_aDFOS.getDataLength ();
    return m_aDFOS.getFile ().length ();
  }
228789
def GetByteSize(self):
    
    if self._byte_size is None and self.members:
      self._byte_size = 0
      for member_definition in self.members:
        byte_size = member_definition.GetByteSize()
        if byte_size is None:
          self._byte_size = None
          break

        self._byte_size = max(self._byte_size, byte_size)

    return self._byte_size
706442
public long getSize() {
        int idSize = dumpClass.getHprofBuffer().getIDSize();

        return dumpClass.classDumpSegment.getMinimumInstanceSize() + HPROF_ARRAY_OVERHEAD + ((long)idSize * getLength());
    }
1350081
def bytes_needed(self):
            ''''''
            if self.native:
                ret = self.native.expected_length - self.buf_len()
            else:
                ret = self.expected_length - self.buf_len()
            
            if ret <= 0:
                return 1
            return ret
256067
public int size() {
        int read = readLocation;
        int write = writeLocation;

        if (write < read)
            write += capacity;

        return write - read;

    }
408471
@Override
    public int size () {
        int size = Smb2Constants.SMB2_HEADER_LENGTH + 24;
        for ( Smb2Lock l : this.locks ) {
            size += l.size();
        }
        return size8(size);
    }