code: final byte[] flattenMapObject(Serializable item) throws IOException {
  
          byte[] serializedItem = null;
  
          /* If it is a byte array, we need to copy it immediately and add a */
          /* header to distinguish it from a serialized object. */
          /* The copy is stored in the Other Property Map. */
          if (item instanceof byte[]) {
              serializedItem = new byte[((byte[]) item).length + 2];
              serializedItem[0] = HEADER_BYTE_0;
              serializedItem[1] = HEADER_BYTE_1;
              System.arraycopy(item, 0, serializedItem, 2, ((byte[]) item).length);
          }
  
          /* Otherwise, serialize it into a byte array and store that in the */
          /* Other Property Map. */
          else {
  
              ByteArrayOutputStream bao = new ByteArrayOutputStream();
              ObjectOutputStream out = new ObjectOutputStream(bao);
              out.writeObject(item);
              out.flush();
              out.close();
              serializedItem = bao.toByteArray();
          }
  
          return serializedItem;
      }
docs: Flatten a Serializable Property or SystemContext item so that it can
  be stored in a map. This also gives us the required safe copy.
  <p>
  The method has package level visibility as it is used by JsSdoMessageImpl.
  
  @param item The Message Property or System Context item
  
  @return A byte array suitable for storing in a Map.
  
  @exception IOException if the item could not be serialized