package Client.ControlPackage;


/**
* Client/ControlPackage/octs4096Helper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.1"
* from ../client.idl
* Donnerstag, 13. Juni 2002 14.16 Uhr CEST
*/


//typedef sequence<octet> octseq;
abstract public class octs4096Helper
{
  private static String  _id = "IDL:Client/Control/octs4096:1.0";

  public static void insert (org.omg.CORBA.Any a, byte[] that)
  {
    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
    a.type (type ());
    write (out, that);
    a.read_value (out.create_input_stream (), type ());
  }

  public static byte[] extract (org.omg.CORBA.Any a)
  {
    return read (a.create_input_stream ());
  }

  private static org.omg.CORBA.TypeCode __typeCode = null;
  synchronized public static org.omg.CORBA.TypeCode type ()
  {
    if (__typeCode == null)
    {
      __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
      __typeCode = org.omg.CORBA.ORB.init ().create_array_tc (4096, __typeCode );
      __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (Client.ControlPackage.octs4096Helper.id (), "octs4096", __typeCode);
    }
    return __typeCode;
  }

  public static String id ()
  {
    return _id;
  }

  public static byte[] read (org.omg.CORBA.portable.InputStream istream)
  {
    byte value[] = null;
    value = new byte[4096];
    for (int _o0 = 0;_o0 < (4096); ++_o0)
    {
      value[_o0] = istream.read_octet ();
    }
    return value;
  }

  public static void write (org.omg.CORBA.portable.OutputStream ostream, byte[] value)
  {
    if (value.length != (4096))
      throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    for (int _i0 = 0;_i0 < (4096); ++_i0)
    {
      ostream.write_octet (value[_i0]);
    }
  }

}
