Java Code Examples for org.omg.CORBA.BooleanSeqHelper

The following are top voted examples for showing how to use org.omg.CORBA.BooleanSeqHelper. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: javify   File: ArrayValueHelper.java   View source code 4 votes vote down vote up
/**
 * 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   View source code 4 votes vote down vote up
/**
 * 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   View source code 4 votes vote down vote up
/**
 * 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   View source code 4 votes vote down vote up
/**
 * 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);
        }

    }
}