Package java.io

Examples of java.io.Externalizable.readExternal()


                {

          Externalizable exColumn = (Externalizable) neColumn;

          inUserCode = true;
          exColumn.readExternal(logicalDataIn);
          inUserCode = false;

          arrayPosition++;
          continue;
        }
View Full Code Here


                    } else {
                        throw new InvalidClassException(type.getName(), "Class is non-public or has no public no-arg constructor");
                    }
                    final int idx = instanceCache.size();
                    instanceCache.add(obj);
                    obj.readExternal(blockUnmarshaller);
                    blockUnmarshaller.readToEndBlockData();
                    blockUnmarshaller.unblock();
                    final Object resolvedObject = objectResolver.readResolve(serializableClass.hasReadResolve() ? serializableClass.callReadResolve(obj) : obj);
                    if (unshared) {
                        instanceCache.set(idx, null);
View Full Code Here

                        idx = instanceCache.size();
                        instanceCache.add(unshared ? UNSHARED : obj);
                        if (obj instanceof Externalizable) {
                            final Externalizable externalizable = (Externalizable) obj;
                            if ((descriptor.getFlags() & SC_BLOCK_DATA) != 0) {
                                externalizable.readExternal(blockUnmarshaller);
                                blockUnmarshaller.readToEndBlockData();
                                blockUnmarshaller.unblock();
                            } else {
                                // data is not in block format!
                                externalizable.readExternal(this);
View Full Code Here

                                externalizable.readExternal(blockUnmarshaller);
                                blockUnmarshaller.readToEndBlockData();
                                blockUnmarshaller.unblock();
                            } else {
                                // data is not in block format!
                                externalizable.readExternal(this);
                            }
                        } else {
                            throw new InvalidObjectException("Created object should be Externalizable but it is not");
                        }
                    } else {
View Full Code Here

                extclass=mConfigurator.get(magic);
            }//end if
            //instantiate the object
            Externalizable newinstance=(Externalizable)extclass.newInstance();
            //populate the object with its data
            newinstance.readExternal(in);
            //return the instance
            return newinstance;
        }
        catch(Throwable x) {
            if(x instanceof IOException)
View Full Code Here

            };
            {
                @SuppressWarnings("resource")
                final CustomObjectInputStream objectInput = CustomObjectInputStream.getInstance(context, callback,
                    classLoaderReference);
                externalizable.readExternal(objectInput);
                objectInput.popCallback();
            }
            return externalizable;
        } catch (final NoSuchMethodException e) {
            throw new ConversionException("Cannot construct " + type.getClass() + ", missing default constructor", e);
View Full Code Here

                {

          Externalizable exColumn = (Externalizable) neColumn;

          inUserCode = true;
          exColumn.readExternal(logicalDataIn);
          inUserCode = false;

          arrayPosition++;
          continue;
        }
View Full Code Here

                        // Read format version
                        readFormatVersion();

                        Externalizable ext = (Externalizable)currentObject;
                        ext.readExternal(this);
                }
            } catch (InvocationTargetException e) {
                InvalidClassException exc = new InvalidClassException(
                    currentClass.getName(),
                    "InvocationTargetException accessing no-arg constructor");
View Full Code Here

                        // Read format version
                        readFormatVersion();

                        Externalizable ext = (Externalizable)currentObject;
                        ext.readExternal(this);
                    }
                } catch (InvocationTargetException e) {
                    InvalidClassException exc = new InvalidClassException(
                        currentClass.getName(),
                        "InvocationTargetException accessing no-arg constructor");
View Full Code Here

                public void close() {
                    throw new UnsupportedOperationException("Objects are not allowed to call ObjectInput.close() from readExternal()");
                }
            };
            CustomObjectInputStream objectInput = CustomObjectInputStream.getInstance(context, callback, classLoader);
            externalizable.readExternal(objectInput);
            objectInput.popCallback();
            return externalizable;
        } catch (NoSuchMethodException e) {
            throw new ConversionException("Cannot construct " + type.getClass() + ", missing default constructor", e);
        } catch (InvocationTargetException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.