// javadoc is inherited
  protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException {

    try {
      byte len = readByte();
      byte[] id = new byte[len];
      readFully(id);

      return classCatalog.getClassFormat(id);
    } catch (DatabaseException e) {
      /*
       * Do not throw IOException from here since ObjectOutputStream
       * will write the exception to the stream, which causes another
       * call here, etc.
       */
      throw new RuntimeExceptionWrapper(e);
    }
  }
Example #2
0
  // javadoc is inherited
  protected void writeClassDescriptor(ObjectStreamClass classdesc) throws IOException {

    try {
      byte[] id = classCatalog.getClassID(classdesc);
      writeByte(id.length);
      write(id);
    } catch (DatabaseException e) {

      /*
       * Do not throw IOException from here since ObjectOutputStream
       * will write the exception to the stream, which causes another
       * call here, etc.
       */
      throw RuntimeExceptionWrapper.wrapIfNeeded(e);
    } catch (ClassNotFoundException e) {
      throw RuntimeExceptionWrapper.wrapIfNeeded(e);
    }
  }