Anonymous avatar Anonymous committed 118af98 Merge

Comments (0)

Files changed (3)

core/src/main/java/com/cubeia/firebase/io/PacketInputStream.java

 		}
 	}
 	
-	public void loadUint8Array(short[] data) throws IOException {
-		for (int i = 0; i < data.length; i++) {
-			data[i] = (short) (inBuffer.get() & 0xff);
-		}
-	}
-    
 	public void loadLongArray(long[] data) throws IOException {
         for (int i = 0; i < data.length; i++) {
             data[i] = inBuffer.getLong();

core/src/main/java/com/cubeia/firebase/io/PacketOutputStream.java

 		}
 	}
 
-	public void saveUint8Array(short[] data) throws IOException {
-		for (short val : data) {
-			saveUnsignedByte(val);
-		}
-	}
-	
-    public void saveArray(long[] data) throws IOException {
+	public void saveArray(long[] data) throws IOException {
         for (long val : data) {
             os.writeLong(val);
         }

maven/protocol-generator-plugin/src/main/scripts/java_generator.rb

     type = jtype(list.obj_type)
     # uint8 array *is* a byte-array
     if(list.obj_type == "uint8")
-      wi("public short[] #{camelcase(list.name)} = new short[0];")
-      result = "short[]"   
+      wi("public byte[] #{camelcase(list.name)} = new byte[0];")
+      result = "byte[]"   
     elsif(builtin?(list.obj_type))
       # If complex type, then use List 
       if (UNSIGNED_TYPES.has_key?(type))
       @indent_level -= 1
       wi("}")
 
-    elsif list.obj_type == "uint8"
-      wi("ps.saveInt(#{name}.length);")
-      wi("ps.saveUint8Array(#{name});")
-   
     elsif list.obj_type == "uint16"
       wi("ps.saveInt(#{name}.length);")
       wi("ps.saveUint16Array(#{name});")
     if(list.obj_type == "uint8")
       # Array of uint8 *is* byte
       wi("int #{name}Count = ps.loadInt();")
-      wi("#{name} = new short[#{name}Count];")
-      wi("ps.loadUint8Array(#{name});")
+      wi("#{name} = new byte[#{name}Count];")
+      wi("ps.loadByteArray(#{name});")
    
     elsif(list.obj_type == "uint16")
         wi("int #{name}Count = ps.loadInt();")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.