public static void read_instance(InputStream input, Object value, int value_tag
private static Object read_instance(InputStream input, Object value, int value_tag, Object helper
  public static void read_instance(InputStream input, Object value,                                   int value_tag                                  )  {    try      {        if ((value_tag & vf_CHUNKING) != 0)          {            ByteArrayOutputStream bout = null;            int n = -1;            // Read all chunks.            int chunk_size = input.read_long();            if (chunk_size <= 0)              throw new MARSHAL("Invalid first chunk size " + chunk_size);            byte[] r = new byte[ chunk_size ];            while (chunk_size > 0)              {                if (r.length < chunk_size)                  r = new byte[ chunk_size + 256 ];                n = 0;                reading:                while (n < chunk_size)                  n += input.read(r, n, r.length - n);                // Read the size of the next chunk.                chunk_size = input.read_long();                // If the value is non negative, there is more than one chunk.                // Accumulate chunks in the buffer.                // The last chunk (or the only chunk, if only one chunk is                // present) is not written in the buffer. It is stored in the                // array r, avoiding unnecessary buffer operations.                if (chunk_size > 0)                  {                    bout = new ByteArrayOutputStream(2 * chunk_size);                    bout.write(r, 0, chunk_size);                  }              }            if (bout != null)              {                // More than one chunk was present.                // Add the last chunk.                bout.write(r, 0, n);                input = new cdrBufInput(bout.toByteArray());              }            else              {                // Only one chunk was present.                input = new cdrBufInput(r);              }          }      }    catch (IOException ex)      {        MARSHAL m = new MARSHAL("Unable to read chunks");        m.initCause(ex);        throw m;      }    // The user-defines io operations are implemented.    if (value instanceof CustomMarshal)      {        CustomMarshal marsh = (CustomMarshal) value;        try          {            marsh.unmarshal((DataInputStream) input);          }        catch (ClassCastException ex)          {            incorrect_plug_in(ex);          }      }    else    // The IDL-generated io operations are implemented.    if (value instanceof Streamable)      {        ((Streamable) value)._read(input);      }    else      // Stating the interfaces that the USER should use.      throw new MARSHAL("The " + value.getClass().getName() +                        " must implement either StreamableValue or CustomValue."                       );    // The negative end of state marker is expected from OMG standard.    // If the chunking is used, this marker is already extracted.    if ((value_tag & vf_CHUNKING) == 0)      {        int eor = input.read_long();        if (eor >= 0)          throw new MARSHAL("End of state marker has an invalid value " + eor);      }  }