ClassNotFoundException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStreamWithWriteDesc1 oos = new ObjectOutputStreamWithWriteDesc1(
baos);
ObjectStreamClass desc = ObjectStreamClass
.lookup(TestClassForSerialization.class);
oos.writeClassDescriptor(desc);
oos.close();
byte[] bytes = baos.toByteArray();
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectIutputStreamWithReadDesc1 ois = new ObjectIutputStreamWithReadDesc1(
bais);
Object obj = ois.readClassDescriptor();
ois.close();
assertEquals(desc.getClass(), obj.getClass());
//eof
bais = new ByteArrayInputStream(bytes);
ExceptionalBufferedInputStream bis = new ExceptionalBufferedInputStream(
bais);