Index: trunk/src/VBox/Main/glue/glue-java.xsl
===================================================================
--- trunk/src/VBox/Main/glue/glue-java.xsl	(revision 31650)
+++ trunk/src/VBox/Main/glue/glue-java.xsl	(revision 31694)
@@ -315,5 +315,5 @@
 
         <xsl:when test="$type='octet'">
-          <xsl:value-of select="'short'" />
+          <xsl:value-of select="'byte'" />
         </xsl:when>
 
@@ -2204,6 +2204,7 @@
 
 public class Helper {
-    public static List<Short> wrap(short[] vals) {
-        if (vals==null || vals.length == 0)  return Collections.emptyList();
+    public static List<Short> wrap(byte[] vals) {
+        if (vals==null)
+            return null;
 
         List<Short> ret = new ArrayList<Short>(vals.length);
@@ -2215,9 +2216,10 @@
 
     public static List<Integer> wrap(int[] vals) {
-        if (vals==null || vals.length == 0)  return Collections.emptyList();
+        if (vals==null)
+             return null;
 
         List<Integer> ret = new ArrayList<Integer>(vals.length);
         for (int v : vals) {
-                ret.add(v);
+             ret.add(v);
         }
         return ret;
@@ -2225,5 +2227,6 @@
 
     public static List<Long> wrap(long[] vals) {
-        if (vals==null || vals.length == 0)  return Collections.emptyList();
+        if (vals==null)
+             return null;
 
         List<Long> ret = new ArrayList<Long>(vals.length);
@@ -2235,9 +2238,9 @@
 
     public static List<String> wrap(String[] vals) {
-        if (vals==null || vals.length == 0)  return Collections.emptyList();
-
+        if (vals==null)
+            return null;
         List<String> ret = new ArrayList<String>(vals.length);
         for (String v : vals) {
-                ret.add(v);
+            ret.add(v);
         }
         return ret;
@@ -2245,5 +2248,6 @@
 
     public static <T> List<T> wrap(Class<T> wrapperClass, T[] thisPtrs) {
-        if (thisPtrs==null || thisPtrs.length == 0)  return Collections.emptyList();
+        if (thisPtrs==null)
+             return null;
 
         List<T> ret = new ArrayList<T>(thisPtrs.length);
@@ -2285,5 +2289,6 @@
 
     public static short[] unwrap(List<Short> vals) {
-        if (vals==null || vals.size() == 0)  return new short[0];
+        if (vals==null)
+           return null;
 
         short[] ret = new short[vals.size()];
@@ -2296,5 +2301,6 @@
 
     public static int[] unwrap(List<Integer> vals) {
-        if (vals==null || vals.size() == 0)  return new int[0];
+        if (vals == null)
+           return null;
 
         int[] ret = new int[vals.size()];
@@ -2307,5 +2313,6 @@
 
     public static long[] unwrap(List<Long> vals) {
-        if (vals==null || vals.size() == 0)  return new long[0];
+        if (vals == null)
+           return null;
 
         long[] ret = new long[vals.size()];
@@ -2318,5 +2325,6 @@
 
     public static boolean[] unwrap(List<Boolean> vals) {
-        if (vals==null || vals.size() == 0)  return new boolean[0];
+        if (vals==null)
+           return null;
 
         boolean[] ret = new boolean[vals.size()];
@@ -2329,5 +2337,6 @@
 
     public static String[] unwrap(List<String> vals) {
-        if (vals==null || vals.size() == 0)  return new String[0];
+        if (vals==null)
+            return null;
 
         String[] ret = new String[vals.size()];
@@ -2365,5 +2374,6 @@
     public static <T1, T2> List<T1> wrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, T2[] thisPtrs) {
         try {
-            if (thisPtrs==null || thisPtrs.length == 0)  return Collections.emptyList();
+            if (thisPtrs==null) 
+                return null;
 
             Constructor<T1> c = wrapperClass1.getConstructor(wrapperClass2);
@@ -2413,5 +2423,5 @@
     @SuppressWarnings("unchecked")
     public static <T1 extends IUnknown,T2> T2[] unwrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, List<T1> thisPtrs) {
-        if (thisPtrs==null || thisPtrs.size() == 0)  return null;
+        if (thisPtrs==null)  return null;
 
         T2 ret[] = (T2[])Array.newInstance(wrapperClass2, thisPtrs.size());
Index: trunk/src/VBox/Main/glue/tests/TestVBox.java
===================================================================
--- trunk/src/VBox/Main/glue/tests/TestVBox.java	(revision 31650)
+++ trunk/src/VBox/Main/glue/tests/TestVBox.java	(revision 31694)
@@ -116,4 +116,39 @@
     }
 
+    /*
+    static void testReadLogBI(VirtualBoxManager mgr, IVirtualBox vbox)
+    {
+        IMachine m =  vbox.getMachines().get(0);
+        long logNo = 0;
+        BigInteger off = BigInteger.valueOf(0);
+        BigInteger size = BigInteger.valueOf(16 * 1024);
+        while (true)
+        {
+            byte[] buf = m.readLog(logNo, off, size);
+            if (buf.length == 0)
+                break;
+            System.out.print(new String(buf));
+            off.add(BigInteger.valueOf(buf.length));
+        }
+    }
+
+    static void testReadLog(VirtualBoxManager mgr, IVirtualBox vbox)
+    {
+        IMachine m =  vbox.getMachines().get(0);
+        long logNo = 0;
+        long off = 0;
+        long size = 16 * 1024;
+        while (true)
+        {
+            byte[] buf = m.readLog(logNo, off, size);
+            if (buf.length == 0)
+                break;
+            System.out.print(new String(buf));
+            off += buf.length;
+        }
+        }
+    */
+
+
     public static void main(String[] args)
     {
@@ -154,4 +189,5 @@
                 System.out.println("VirtualBox version: " + vbox.getVersion() + "\n");
                 testEnumeration(mgr, vbox);
+                //testReadLog(mgr, vbox);
                 testStart(mgr, vbox);
                 testEvents(mgr, vbox.getEventSource());
