public override void readPacketData(DataInputStream datainputstream) { xPosition = datainputstream.readInt(); yPosition = datainputstream.readShort(); zPosition = datainputstream.readInt(); xSize = datainputstream.read() + 1; ySize = datainputstream.read() + 1; zSize = datainputstream.read() + 1; chunkSize = datainputstream.readInt(); var abyte0 = new byte[chunkSize]; datainputstream.readFully(abyte0); chunk = new byte[(xSize * ySize * zSize * 5) / 2]; var inflater = new Inflater(); inflater.setInput(abyte0); try { inflater.inflate(chunk); } catch (DataFormatException dataformatexception) { throw new IOException("Bad compressed data format"); } finally { inflater.end(); } }
public override void readPacketData(DataInputStream datainputstream) { xPosition = datainputstream.readInt(); yPosition = datainputstream.read(); zPosition = datainputstream.readInt(); type = datainputstream.read(); metadata = datainputstream.read(); }
public override void readPacketData(DataInputStream datainputstream) { status = datainputstream.read(); xPosition = datainputstream.readInt(); yPosition = datainputstream.read(); zPosition = datainputstream.readInt(); face = datainputstream.read(); }
public override void readPacketData(DataInputStream datainputstream) { xLocation = datainputstream.readInt(); yLocation = datainputstream.readShort(); zLocation = datainputstream.readInt(); instrumentType = datainputstream.read(); pitch = datainputstream.read(); }
public override void readPacketData(DataInputStream datainputstream) { entityId = datainputstream.readInt(); xPosition = datainputstream.readInt(); yPosition = datainputstream.readInt(); zPosition = datainputstream.readInt(); yaw = (byte)datainputstream.read(); pitch = (byte)datainputstream.read(); }
// Token: 0x060008C8 RID: 2248 RVA: 0x0007FA94 File Offset: 0x0007DC94 public static void loadMapFromResource(int mapID) { DataInputStream dataInputStream = MyStream.readFile("/mymap/" + TileMap.mapID); TileMap.tmw = (int)((ushort)dataInputStream.read()); TileMap.tmh = (int)((ushort)dataInputStream.read()); TileMap.maps = new int[dataInputStream.available()]; for (int i = 0; i < TileMap.tmw * TileMap.tmh; i++) { TileMap.maps[i] = (int)((ushort)dataInputStream.read()); } TileMap.types = new int[TileMap.maps.Length]; }
private string[] readWords(DataInputStream dataInputStream, int num, int num2) { string[] array = new string[num2]; byte[] array2 = new byte[num]; this.bytesRead += (long)dataInputStream.read(array2); int num3 = 0; int num4 = 0; for (int i = 0; i < num; i++) { int num5 = (int)((ushort)array2[i]); this.bytesRead += 1L; if (num5 == 0) { array[num3] = String.newhelper(array2, num4, i - num4); num4 = i + 1; if (String.instancehelper_equals(array[num3], "<s>")) { this.startWordID = num3; } else if (String.instancehelper_equals(array[num3], "</s>")) { this.endWordID = num3; } num3++; } } if (!BinaryLoader.assertionsDisabled && num3 != num2) { throw new AssertionError(); } return(array); }
private static bool loadSection( DataInputStream @in, List <Object3D> objectList, List <Object3D> rootObjectList) { if (@in.read() == -1) { return(false); } int num = Loader.readIntLE(ref @in); Loader.readIntLE(ref @in); int length = num - 13; sbyte[] numArray = new sbyte[length]; @in.readFully(numArray, length); @in.skip(4L); DataInputStream in1 = new DataInputStream((InputStream) new ByteArrayInputStream(numArray, length)); do { ; }while (Loader.loadObject(ref in1, ref objectList, ref rootObjectList)); return(true); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public PackInput readBytes(byte[] into, int offset, int toRead) throws java.io.IOException public override PackInput ReadBytes(sbyte[] into, int offset, int toRead) { // TODO: fix the interface and all implementations - we should probably // TODO: return the no of bytes read instead of the instance _data.read(into, offset, toRead); return(this); }
public override void readPacketData(DataInputStream datainputstream) { xPosition = datainputstream.readInt(); yPosition = datainputstream.read(); zPosition = datainputstream.readInt(); direction = datainputstream.read(); short word0 = datainputstream.readShort(); if (word0 >= 0) { byte byte0 = datainputstream.readByte(); short word1 = datainputstream.readShort(); itemStack = new ItemStack(word0, byte0, word1); } else { itemStack = null; } }
private string readString(DataInputStream dataInputStream, int num) { StringBuilder stringBuilder = new StringBuilder(); byte[] array = new byte[num]; dataInputStream.read(array); for (int i = 0; i < num; i++) { stringBuilder.append((char)array[i]); } return(stringBuilder.toString()); }
private void loadModelData(InputStream inputStream) { DataInputStream dataInputStream = new DataInputStream(new BufferedInputStream(inputStream)); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); byte[] array = new byte[4096]; while (dataInputStream.read(array) >= 0) { byteArrayOutputStream.write(array); } this.modelData = byteArrayOutputStream.toByteArray(); }
// Token: 0x06000613 RID: 1555 RVA: 0x0004AFDC File Offset: 0x000491DC public static void loadMapFromResource(sbyte[] mapID) { Res.outz("newwwwwwwwww ============="); for (int i = 0; i < mapID.Length; i++) { DataInputStream dataInputStream = MyStream.readFile("/mymap/" + mapID[i]); MapTemplate.tmw[i] = (int)((ushort)dataInputStream.read()); MapTemplate.tmh[i] = (int)((ushort)dataInputStream.read()); Cout.LogError(string.Concat(new object[] { "Thong TIn : ", MapTemplate.tmw[i], "::", MapTemplate.tmh[i] })); MapTemplate.maps[i] = new int[dataInputStream.available()]; Cout.LogError("lent= " + MapTemplate.maps[i].Length); for (int j = 0; j < MapTemplate.tmw[i] * MapTemplate.tmh[i]; j++) { MapTemplate.maps[i][j] = dataInputStream.read(); } MapTemplate.types[i] = new int[MapTemplate.maps[i].Length]; } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private static byte[] read(java.io.DataInputStream dataIn, int howMany) throws java.io.IOException private static sbyte[] Read(DataInputStream dataIn, int howMany) { Debug.Assert(howMany > 0); sbyte[] buffer = new sbyte[howMany]; int offset = 0; while (offset < howMany) { int read = dataIn.read(buffer, offset, howMany - offset); if (read == 0) { Thread.yield(); } offset += read; } return(buffer); }
public static Packet readPacket(DataInputStream datainputstream) { int i = 0; Packet packet = null; datainputstream.mark(16384); try { i = datainputstream.read(); if (i == -1) { return(null); } packet = getNewPacket(i); if (packet == null) { throw new IOException((new StringBuilder()).append("Bad packet id ").append(i).toString()); } packet.readPacketData(datainputstream); } catch (EOFException eofexception) { [email protected]("Reached end of stream"); datainputstream.reset(); return(null); } var packetcounter = (PacketCounter)field_21904_c.get(Integer.valueOf(i)); if (packetcounter == null) { packetcounter = new PacketCounter(null); field_21904_c.put(Integer.valueOf(i), packetcounter); } packetcounter.func_22150_a(packet.getPacketSize()); field_21903_d++; if (field_21903_d % 1000 != 0) { ; } return(packet); }
private void func_22107_a(File file, ArrayList arraylist, int i, int j, IProgressUpdate iprogressupdate) { Collections.sort(arraylist); var abyte0 = new byte[4096]; int i1; for (Iterator iterator = arraylist.iterator(); iterator.hasNext(); iprogressupdate.setLoadingProgress(i1)) { var filematcher = (FileMatcher)iterator.next(); int k = filematcher.func_22205_b(); int l = filematcher.func_22204_c(); RegionFile regionfile = RegionFileCache.func_22123_a(file, k, l); if (!regionfile.isChunkSaved(k & 0x1f, l & 0x1f)) { try { var datainputstream = new DataInputStream(new GZIPInputStream(new FileInputStream(filematcher.func_22207_a()))); DataOutputStream dataoutputstream = regionfile.getChunkDataOutputStream(k & 0x1f, l & 0x1f); for (int j1 = 0; (j1 = datainputstream.read(abyte0)) != -1;) { dataoutputstream.write(abyte0, 0, j1); } dataoutputstream.close(); datainputstream.close(); } catch (IOException ioexception) { ioexception.printStackTrace(); } } i++; i1 = (int)Math.round((100D * i) / j); } RegionFileCache.func_22122_a(); }
public override void readPacketData(DataInputStream datainputstream) { xPosition = datainputstream.readInt(); yPosition = datainputstream.readInt(); mode = datainputstream.read() != 0; }
public override void readPacketData(DataInputStream datainputstream) { onGround = datainputstream.read() != 0; }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void get(byte[] bytes, int length) throws java.io.IOException public override void Get(sbyte[] bytes, int length) { _dataInputStream.read(bytes, 0, length); }
private static bool loadObject( ref DataInputStream @in, ref List <Object3D> objectList, ref List <Object3D> rootObjectList) { int num = @in.read(); if (num == -1) { return(false); } int length = Loader.readIntLE(ref @in); sbyte[] numArray = new sbyte[length]; @in.readFully(numArray, length); DataInputStream in1 = new DataInputStream((InputStream) new ByteArrayInputStream(numArray, length)); object obj = (object)null; switch (num) { case 0: in1.readUnsignedByte(); in1.readUnsignedByte(); in1.readBoolean(); Loader.readIntLE(ref in1); Loader.readIntLE(ref in1); break; case 1: obj = Loader.loadAnimationController(ref in1, ref objectList, ref rootObjectList); break; case 2: obj = Loader.loadAnimationTrack(ref in1, ref objectList, ref rootObjectList); break; case 3: obj = Loader.loadAppearance(ref in1, ref objectList, ref rootObjectList); break; case 5: obj = Loader.loadCamera(ref in1, ref objectList, ref rootObjectList); break; case 6: obj = Loader.loadCompositingMode(ref in1, ref objectList, ref rootObjectList); break; case 8: obj = Loader.loadPolygonMode(ref in1, ref objectList, ref rootObjectList); break; case 9: obj = (object)new Group(); Loader.loadGroup((Group)obj, ref in1, ref objectList, ref rootObjectList); break; case 10: obj = Loader.loadImage2D(ref in1, ref objectList, ref rootObjectList); break; case 11: obj = Loader.loadTriangleStripArray(ref in1, ref objectList, ref rootObjectList); break; case 14: obj = (object)new Mesh(); Loader.loadMesh((Mesh)obj, ref in1, ref objectList, ref rootObjectList); break; case 16: obj = Loader.loadSkinnedMesh(ref in1, ref objectList, ref rootObjectList); break; case 17: obj = Loader.loadTexture2D(ref in1, ref objectList, ref rootObjectList); break; case 19: obj = Loader.loadKeyframeSequence(ref in1, ref objectList, ref rootObjectList); break; case 20: obj = Loader.loadVertexArray(ref in1, ref objectList, ref rootObjectList); break; case 21: obj = Loader.loadVertexBuffer(ref in1, ref objectList, ref rootObjectList); break; case 22: obj = Loader.loadWorld(ref in1, ref objectList, ref rootObjectList); break; } objectList.Add((Object3D)obj); if (obj != null) { rootObjectList.Add((Object3D)obj); } return(true); }