"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main/java/com/rapidminer/operator/tools/IOObjectSerializer.java" between
rapidminer-studio-9.4.1-src.tar.gz and rapidminer-studio-9.5.0-src.tar.gz

About: RapidMiner Studio is a code-free environment for designing advanced analytic processes with machine learning, data mining, text mining, predictive analytics and business analytics. Java source.

IOObjectSerializer.java  (rapidminer-studio-9.4.1-src):IOObjectSerializer.java  (rapidminer-studio-9.5.0-src)
skipping to change at line 21 skipping to change at line 21
* *
* This program is distributed in the hope that it will be useful, but WITHOUT A NY WARRANTY; without * This program is distributed in the hope that it will be useful, but WITHOUT A NY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURP OSE. See the GNU * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURP OSE. See the GNU
* Affero General Public License for more details. * Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License alon g with this program. * You should have received a copy of the GNU Affero General Public License alon g with this program.
* If not, see http://www.gnu.org/licenses/. * If not, see http://www.gnu.org/licenses/.
*/ */
package com.rapidminer.operator.tools; package com.rapidminer.operator.tools;
import com.rapidminer.adaption.belt.TableViewingTools;
import com.rapidminer.example.ExampleSet;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InvalidObjectException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Arrays; import java.util.Arrays;
import com.rapidminer.adaption.belt.TableViewingTools;
import com.rapidminer.belt.table.BeltConverter;
import com.rapidminer.example.ExampleSet;
/** /**
* *
* @author Simon Fischer * @author Simon Fischer
* *
*/ */
public class IOObjectSerializer { public class IOObjectSerializer {
public static final byte[] MAGIC_NUMBER = { (byte) 0x2A, (byte) 0x71, (by te) 0xD1 }; public static final byte[] MAGIC_NUMBER = { (byte) 0x2A, (byte) 0x71, (by te) 0xD1 };
private static final IOObjectSerializer INSTANCE = new IOObjectSerializer (); private static final IOObjectSerializer INSTANCE = new IOObjectSerializer ();
public static IOObjectSerializer getInstance() { public static IOObjectSerializer getInstance() {
return INSTANCE; return INSTANCE;
} }
/** Serializes the object with a default type appropriate for the given o bject. */ /** Serializes the object with a default type appropriate for the given o bject. */
public void serialize(OutputStream out, Object object) throws IOException { public void serialize(OutputStream out, Object object) throws IOException {
object = TableViewingTools.replaceTableObject(object); try {
object = TableViewingTools.replaceTableObject(object);
} catch (BeltConverter.ConversionException e) {
throw new InvalidObjectException("Custom column " + e.get
ColumnName()
+ " of type " + e.getType().customTypeID(
) + " not serializable");
}
SerializationType type; SerializationType type;
if (object instanceof ExampleSet) { if (object instanceof ExampleSet) {
type = SerializationType.STREAMED_EXAMPLE_SET_DENSE_CURRE NT_VERSION; type = SerializationType.STREAMED_EXAMPLE_SET_DENSE_CURRE NT_VERSION;
} else { } else {
type = SerializationType.JAVA_BINARY; type = SerializationType.JAVA_BINARY;
} }
serialize(out, object, type); serialize(out, object, type);
} }
public void writeHeader(OutputStream out, SerializationType serialization Type) throws IOException { public void writeHeader(OutputStream out, SerializationType serialization Type) throws IOException {
 End of changes. 4 change blocks. 
4 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)