code: public static AbstractMessage createInstance( byte type )
      {
          switch (type)
          {
              case EMPTY:  return new EmptyMessageImpl();
              case BYTES:  return new BytesMessageImpl();
              case MAP:    return new MapMessageImpl();
              case OBJECT: return new ObjectMessageImpl();
              case STREAM: return new StreamMessageImpl();
              case TEXT:   return new TextMessageImpl();
                  
              default:
                  throw new IllegalArgumentException("Unsupported message type : "+type);
          }
      }
docs: Create a message instance of the given type