/** * Deserializes a {@link Binding} by reading bytes from the specified input * stream. It assumes the output is not compressed. * * @param in * the input stream to read from. * * @return the {@link Binding} read from the input stream. */ public static Binding deserializeBinding(InputStream in) { return deserializeBinding(in, false); }
/** * Serializes the specified {@code binding} into the given output stream. By * default the output is not compressed. * * @param out * the output stream to write in. * @param binding * the {@link Binding} to serialize. */ public static void serialize(OutputStream out, Binding binding) { serialize(out, binding, false); }
/** * Deserializes a {@link Model} by reading bytes from the specified input * stream. It assumes the output is not compressed. * * @param in * the input stream to read from. * * @return the {@link Model} read from the input stream. */ public static Model deserializeModel(InputStream in) { return deserializeModel(in, false); }
/** * Deserializes a {@link ResultSet} by reading bytes from the specified * input stream. It assumes the output is not compressed. * * @param in * the input stream to read from. * * @return the {@link ResultSet} read from the input stream. */ public static ResultSet deserializeResultSet(InputStream in) { return deserializeResultSet(in, false); }
/** * {@inheritDoc} */ @Override protected void internalReadObject(ObjectInputStream in) throws IOException { this.object = SparqlResultSerializer.deserializeResultSet( in, EventCloudProperties.COMPRESSION.getValue()); }
/** * Serializes the specified {@code resultSet} into the given output stream * by using the TSV format. By default the output is not compressed. * * @param out * the output stream to write in. * @param resultSet * the {@link ResultSet} to serialize. */ public static void serialize(OutputStream out, ResultSet resultSet) { serialize(out, resultSet, false); }
/** * {@inheritDoc} */ @Override protected void internalReadObject(ObjectInputStream in) throws IOException, ClassNotFoundException { super.object = SparqlResultSerializer.deserializeBinding( in, EventCloudProperties.COMPRESSION.getValue()); }
/** * {@inheritDoc} */ @Override protected void internalReadObject(ObjectInputStream in) throws IOException, ClassNotFoundException { this.object = SparqlResultSerializer.deserializeModel( in, EventCloudProperties.COMPRESSION.getValue()); }
/** * Serializes the specified {@code model} by using the TURTLE syntax. By * default the output is not compressed. * * @param out * the output stream to write in. * @param model * the {@link Model} to serialize. */ public static void serialize(OutputStream out, Model model) { serialize(out, model, false); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); Binding binding = SparqlResultSerializer.deserializeBinding( in, EventCloudProperties.COMPRESSION.getValue()); this.content = new HashMap<Var, Node>(); Iterator<Var> it = binding.vars(); while (it.hasNext()) { Var var = it.next(); this.content.put(var, binding.get(var)); } } }
/** * {@inheritDoc} */ @Override protected void internalWriteObject(ObjectOutputStream out) throws IOException { SparqlResultSerializer.serialize( out, super.object, EventCloudProperties.COMPRESSION.getValue()); }
/** * {@inheritDoc} */ @Override protected void internalWriteObject(ObjectOutputStream out) throws IOException { SparqlResultSerializer.serialize( out, this, EventCloudProperties.COMPRESSION.getValue()); }
/** * {@inheritDoc} */ @Override protected void internalWriteObject(ObjectOutputStream out) throws IOException { SparqlResultSerializer.serialize( out, this, EventCloudProperties.COMPRESSION.getValue()); }
private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); SparqlResultSerializer.serialize( out, this, EventCloudProperties.COMPRESSION.getValue()); }