private void writeObject(ObjectOutputStream stream) throws IOException { PutField fields = stream.putFields(); fields.put("document", document); // TODO: not correct; we need to upload the content via the file transfer service and then send a RepositoryInputStream ByteArrayInputStream bais; InputStream content = source.getInputStream(); if (content instanceof ByteArrayInputStream) { bais = (ByteArrayInputStream)content; } else { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int c; while ((c = content.read(buffer)) != -1) { baos.write(buffer, 0, c); } bais = new ByteArrayInputStream(baos.toByteArray()); } finally { content.close(); } } fields.put("source", bais); stream.writeFields(); }
private void writeObject (ObjectOutputStream s) throws IOException { if (getClass().getClassLoader() != null) { throw new SecurityException ("invalid address type"); } PutField pf = s.putFields(); pf.put("hostName", holder().getHostName()); pf.put("address", holder().getAddress()); pf.put("family", holder().getFamily()); s.writeFields(); }
private void writeObject(ObjectOutputStream s) throws IOException { Hashtable<String,PermissionCollection> permTable = new Hashtable<>(perms); ObjectOutputStream.PutField fields = s.putFields(); fields.put("perms", permTable); s.writeFields(); }
private void writeObject (ObjectOutputStream s) throws IOException { if (getClass().getClassLoader() != null) { throw new SecurityException ("invalid address type"); } PutField pf = s.putFields(); pf.put("hostName", holder().hostName); pf.put("address", holder().address); pf.put("family", holder().family); s.writeFields(); }
private void writeObject(final ObjectOutputStream out) throws java.io.IOException { final PutField fields = out.putFields(); fields.put("delegate", delegate); // isImmutable in this class is purely informational and ignored by readObject method! fields.put("isImmutable", isImmutable()); out.writeFields(); }
public PutField putFields() throws IOException { if (out instanceof ObjectOutputStream) { return ((ObjectOutputStream)out).putFields(); } else { throw new IOException("This method is not supported."); } }
public ObjectOutputStream.PutField putFields() { CustomPutField localCustomPutField = new CustomPutField(null); this.customFields.push(localCustomPutField); return localCustomPutField; }
private void writeObject(ObjectOutputStream out) throws IOException { PutField putFields = out.putFields(); putFields.put("roles", new ArrayList<Role>(this.roles)); out.writeFields(); }
private void writeObject(final ObjectOutputStream out) throws java.io.IOException { final PutField fields = out.putFields(); fields.put("isImmutable", isImmutable()); out.writeFields(); }
private void writeObject(ObjectOutputStream stream) throws IOException { PutField fields = stream.putFields(); fields.put("listenerId", listenerId); fields.put("info", new NotificationInfo(name, filter)); stream.writeFields(); }