protected Object readContent(ObjectDataInput in) throws IOException { if (in.readBoolean()) { if (repo == null) { repo = getRepository(); } if (repo != null) { ContentSerializer cs = repo.getSerializer(contentType); if (cs != null) { return cs.readContent(in); } } throw new IllegalStateException("Cannot read serialized content: absent SchemaRepository"); } return in.readObject(); }
boolean compress = Boolean.parseBoolean(context.getProperty(pn_document_compress, "false")); if (format != null) { ContentSerializer cs = repo.getSerializer(format); if (cs != null) { if (compress) {
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public void writeData(ObjectDataOutput out) throws IOException { super.writeData(out); boolean compress = Boolean.parseBoolean(context.getProperty(pn_document_compress, "false")); String format = context.getProperty(pn_document_data_format); if (format != null) { ContentSerializer cs = repo.getSerializer(format); if (cs != null) { if (compress) { writeCompressedContent(out, cs, content); } else { cs.writeContent(out, content); } return; } } if (compress) { writeCompressedData(out, content); } else { out.writeObject(content); } }
@Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void readData(ObjectDataInput in) throws IOException { super.readData(in); checkRepo(); boolean compress = Boolean.parseBoolean(context.getProperty(pn_document_compress, "false")); String format = context.getProperty(pn_document_data_format); if (format != null) { ContentSerializer cs = repo.getSerializer(format); if (cs != null) { if (compress) { content = readCompressedContent(in, cs); } else { content = cs.readContent(in); } return; } } if (compress) { content = readCompressedData(in); } else { content = in.readObject(); } }
boolean compress = Boolean.parseBoolean(context.getProperty(pn_document_compress, "false")); if (format != null) { ContentSerializer cs = repo.getSerializer(format); if (cs != null) { if (compress) {
protected void writeContent(ObjectDataOutput out) throws IOException { if (repo == null) { repo = getRepository(); } if (repo != null) { ContentSerializer cs = repo.getSerializer(contentType); if (cs != null) { out.writeBoolean(true); cs.writeContent(out, content); return; } } out.writeBoolean(false); out.writeObject(content); }