@Override
  public void writePayload(final ByteWriter out) throws IOException {
    switch(getType()) {
      case BYTE:
        out.write((Byte) payload);
        break;
      case SHORT:
        out.write((Short) payload);
        break;
      case INT:
        out.write((Integer) payload);
        break;
      case LONG:
        out.write((Long) payload);
        break;
      case FLOAT:
        out.write((Float) payload);
        break;
      case DOUBLE:
        out.write((Double) payload);
        break;
      default:
        throw new InternalError("missing type? " + getType());
    }
  }