code: public void writeObject(@NonNull ObjectOutputStream stream) throws IOException {
          stream.writeObject(id);
          stream.writeLong(createdTime);
          stream.writeLong(lastAccessedTime);
          stream.writeInt(maxInactiveInterval);
          stream.writeBoolean(isNew);
          stream.writeBoolean(isValid);
          stream.writeInt(mAttributes.size());
          String keys[] = mAttributes.keySet().toArray(EMPTY_ARRAY);
          for (String key : keys) {
              Object value = mAttributes.get(key);
              if (value != null && value instanceof Serializable) {
                  stream.writeObject(key);
                  stream.writeObject(value);
              }
          }
      }
docs: Write attribute values to the stream.
  
  @param stream stream.
  
  @throws IOException if the output error occurs while processing this request.