public byte[] toStream() throws OSerializationException {
return queryToStream().toByteArray();
}
protected OMemoryStream queryToStream() {
final OMemoryStream buffer = new OMemoryStream();
buffer.setUtf8(text); // TEXT AS STRING
buffer.set(limit); // LIMIT AS INTEGER
buffer.setUtf8(fetchPlan != null ? fetchPlan : ""); // FETCH PLAN IN FORM OF STRING (to know more goto:
// http://code.google.com/p/orient/wiki/FetchingStrategies)
buffer.set(serializeQueryParameters(parameters));
return buffer;
}