package org.kde.koala; import java.io.*; /** * This marchaller can convert between serialized Qt objects and Java objects. * * (Scooped the code of Stub.java from the javadcop project, and made the operations static and public) */ public class Marchaller { // accessor methods for the datatypes used --------------------------- public static boolean read_bool(DataInputStream is) throws IOException { return is.readBoolean(); } public static void write_bool(DataOutputStream os, boolean val) throws IOException { os.writeBoolean(val); } public static short read_short_int(DataInputStream is) throws IOException { return is.readShort(); } public static void write_short_int(DataOutputStream os, short val) throws IOException { os.writeShort(val); } public static int read_int(DataInputStream is) throws IOException { return is.readInt(); } public static void write_int(DataOutputStream os, int val) throws IOException { os.writeInt(val); } public static int read_long_int(DataInputStream is) throws IOException { return is.readInt(); } public static void write_long_int(DataOutputStream os, int val) throws IOException { os.writeInt(val); } public static float read_float(DataInputStream is) throws IOException { return is.readFloat(); } public static void write_float(DataOutputStream os, float val) throws IOException { os.writeFloat(val); } public static double read_double(DataInputStream is) throws IOException { return is.readDouble(); } public static void write_double(DataOutputStream os, double val) throws IOException { os.writeDouble(val); } public static String read_QString(DataInputStream is) throws IOException { int len = is.readInt(); if (len == 0xffffffff) return new String(); else { StringBuffer b = new StringBuffer(); for (int i=0; i