Java Code Examples for org.omg.CORBA.FloatSeqHelper.write()

The following are Jave code examples for showing how to use write() of the org.omg.CORBA.FloatSeqHelper class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: javify   File: ArrayValueHelper.java   Source Code and License Vote up 4 votes
/**
 * Write the array to the input stream.
 */
public void write_value(OutputStream output, Serializable value)
{
  if (output instanceof gnuValueStream)
    {
      gnuRuntime r = ((gnuValueStream) output).getRunTime();
      if (r != null)
        r.target = null;
    }

  if (value instanceof byte[])
    OctetSeqHelper.write(output, (byte[]) value);
  else if (value instanceof String[])
    {
      String[] s = (String[]) value;
      output.write_long(s.length);
      for (int i = 0; i < s.length; i++)
        Vio.write(output, s[i], Vio.m_StringValueHelper);
    }
  else if (value instanceof int[])
    LongSeqHelper.write(output, (int[]) value);
  else if (value instanceof long[])
    LongLongSeqHelper.write(output, (long[]) value);
  else if (value instanceof double[])
    DoubleSeqHelper.write(output, (double[]) value);
  else if (value instanceof float[])
    FloatSeqHelper.write(output, (float[]) value);
  else if (value instanceof boolean[])
    BooleanSeqHelper.write(output, (boolean[]) value);
  else if (value instanceof short[])
    ShortSeqHelper.write(output, (short[]) value);
  else if (value instanceof char[])
    CharSeqHelper.write(output, (char[]) value);
  else
    {
      // Write others, use reflection.
      component = arrayClass.getComponentType();

      int n = Array.getLength(value);
      output.write_long(n);
      if (written_as_object())
        for (int i = 0; i < n; i++)
          {
            Object o = Array.get(value, i);
            if (o == null)
              output.write_Object(null);
            else
              // CORBA objects have another notation.
              handler.writeValue(output, (Serializable) o);
          }
      else
        {
          for (int i = 0; i < n; i++)
            Vio.write(output, (Serializable) Array.get(value, i),
              component);
        }

    }
}
 
Example 2
Project: jvm-stm   File: ArrayValueHelper.java   Source Code and License Vote up 4 votes
/**
 * Write the array to the input stream.
 */
public void write_value(OutputStream output, Serializable value)
{
  if (output instanceof gnuValueStream)
    {
      gnuRuntime r = ((gnuValueStream) output).getRunTime();
      if (r != null)
        r.target = null;
    }

  if (value instanceof byte[])
    OctetSeqHelper.write(output, (byte[]) value);
  else if (value instanceof String[])
    {
      String[] s = (String[]) value;
      output.write_long(s.length);
      for (int i = 0; i < s.length; i++)
        Vio.write(output, s[i], Vio.m_StringValueHelper);
    }
  else if (value instanceof int[])
    LongSeqHelper.write(output, (int[]) value);
  else if (value instanceof long[])
    LongLongSeqHelper.write(output, (long[]) value);
  else if (value instanceof double[])
    DoubleSeqHelper.write(output, (double[]) value);
  else if (value instanceof float[])
    FloatSeqHelper.write(output, (float[]) value);
  else if (value instanceof boolean[])
    BooleanSeqHelper.write(output, (boolean[]) value);
  else if (value instanceof short[])
    ShortSeqHelper.write(output, (short[]) value);
  else if (value instanceof char[])
    CharSeqHelper.write(output, (char[]) value);
  else
    {
      // Write others, use reflection.
      component = arrayClass.getComponentType();

      int n = Array.getLength(value);
      output.write_long(n);
      if (written_as_object())
        for (int i = 0; i < n; i++)
          {
            Object o = Array.get(value, i);
            if (o == null)
              output.write_Object(null);
            else
              // CORBA objects have another notation.
              handler.writeValue(output, (Serializable) o);
          }
      else
        {
          for (int i = 0; i < n; i++)
            Vio.write(output, (Serializable) Array.get(value, i),
              component);
        }

    }
}
 
Example 3
Project: JamVM-PH   File: ArrayValueHelper.java   Source Code and License Vote up 4 votes
/**
 * Write the array to the input stream.
 */
public void write_value(OutputStream output, Serializable value)
{
  if (output instanceof gnuValueStream)
    {
      gnuRuntime r = ((gnuValueStream) output).getRunTime();
      if (r != null)
        r.target = null;
    }

  if (value instanceof byte[])
    OctetSeqHelper.write(output, (byte[]) value);
  else if (value instanceof String[])
    {
      String[] s = (String[]) value;
      output.write_long(s.length);
      for (int i = 0; i < s.length; i++)
        Vio.write(output, s[i], Vio.m_StringValueHelper);
    }
  else if (value instanceof int[])
    LongSeqHelper.write(output, (int[]) value);
  else if (value instanceof long[])
    LongLongSeqHelper.write(output, (long[]) value);
  else if (value instanceof double[])
    DoubleSeqHelper.write(output, (double[]) value);
  else if (value instanceof float[])
    FloatSeqHelper.write(output, (float[]) value);
  else if (value instanceof boolean[])
    BooleanSeqHelper.write(output, (boolean[]) value);
  else if (value instanceof short[])
    ShortSeqHelper.write(output, (short[]) value);
  else if (value instanceof char[])
    CharSeqHelper.write(output, (char[]) value);
  else
    {
      // Write others, use reflection.
      component = arrayClass.getComponentType();

      int n = Array.getLength(value);
      output.write_long(n);
      if (written_as_object())
        for (int i = 0; i < n; i++)
          {
            Object o = Array.get(value, i);
            if (o == null)
              output.write_Object(null);
            else
              // CORBA objects have another notation.
              handler.writeValue(output, (Serializable) o);
          }
      else
        {
          for (int i = 0; i < n; i++)
            Vio.write(output, (Serializable) Array.get(value, i),
              component);
        }

    }
}
 
Example 4
Project: classpath   File: ArrayValueHelper.java   Source Code and License Vote up 4 votes
/**
 * Write the array to the input stream.
 */
public void write_value(OutputStream output, Serializable value)
{
  if (output instanceof gnuValueStream)
    {
      gnuRuntime r = ((gnuValueStream) output).getRunTime();
      if (r != null)
        r.target = null;
    }

  if (value instanceof byte[])
    OctetSeqHelper.write(output, (byte[]) value);
  else if (value instanceof String[])
    {
      String[] s = (String[]) value;
      output.write_long(s.length);
      for (int i = 0; i < s.length; i++)
        Vio.write(output, s[i], Vio.m_StringValueHelper);
    }
  else if (value instanceof int[])
    LongSeqHelper.write(output, (int[]) value);
  else if (value instanceof long[])
    LongLongSeqHelper.write(output, (long[]) value);
  else if (value instanceof double[])
    DoubleSeqHelper.write(output, (double[]) value);
  else if (value instanceof float[])
    FloatSeqHelper.write(output, (float[]) value);
  else if (value instanceof boolean[])
    BooleanSeqHelper.write(output, (boolean[]) value);
  else if (value instanceof short[])
    ShortSeqHelper.write(output, (short[]) value);
  else if (value instanceof char[])
    CharSeqHelper.write(output, (char[]) value);
  else
    {
      // Write others, use reflection.
      component = arrayClass.getComponentType();

      int n = Array.getLength(value);
      output.write_long(n);
      if (written_as_object())
        for (int i = 0; i < n; i++)
          {
            Object o = Array.get(value, i);
            if (o == null)
              output.write_Object(null);
            else
              // CORBA objects have another notation.
              handler.writeValue(output, (Serializable) o);
          }
      else
        {
          for (int i = 0; i < n; i++)
            Vio.write(output, (Serializable) Array.get(value, i),
              component);
        }

    }
}