Package net.bnubot.util

Examples of net.bnubot.util.BNetOutputStream.writeWord()


    ) {
      //FTP
      os.writeByte(0x02);

      //File request
      os.writeWord(32 + fileName.length() + 1);
      os.writeWord(0x100);    // Protocol version
      os.writeDWord(PlatformIDs.PLATFORM_IX86)// Platform ID
      os.writeDWord(cs.product.getDword())// Product ID
      os.writeDWord(0);    // Banners ID
      os.writeDWord(0);    // Banners File Extension
View Full Code Here


      //FTP
      os.writeByte(0x02);

      //File request
      os.writeWord(32 + fileName.length() + 1);
      os.writeWord(0x100);    // Protocol version
      os.writeDWord(PlatformIDs.PLATFORM_IX86)// Platform ID
      os.writeDWord(cs.product.getDword())// Product ID
      os.writeDWord(0);    // Banners ID
      os.writeDWord(0);    // Banners File Extension
      os.writeDWord(0);    // File position
View Full Code Here

  public void sendPacket(OutputStream out) throws IOException, SocketException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    try (BNetOutputStream sckout = new BNetOutputStream(baos)) {
      byte raw_data[] = ((ByteArrayOutputStream)this.out).toByteArray();
      sckout.writeWord(raw_data.length + 3);
      sckout.writeByte(packetId.ordinal());
      sckout.write(raw_data);
    } catch(IOException e) {
      Out.fatalException(e);
    }
View Full Code Here

      String msg = "RECV " + packetId.name();
      if(Out.isDebug()) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try (BNetOutputStream os = new BNetOutputStream(baos)) {
          os.writeByte(packetId.ordinal());
          os.writeWord(packetLength);
          os.write(data);
        }
        msg += "\n" + HexDump.hexDump(baos.toByteArray());
      }
      Out.debugAlways(getClass(), msg);
View Full Code Here

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      BNetOutputStream headerStream = new BNetOutputStream(baos);
    ) {
      Out.debug(IconsDotBniReader.class, "Writing " + f.getName());

      headerStream.writeWord(1); // BNI version
      headerStream.writeWord(0); // Alignment Padding (unused)
      headerStream.writeDWord(icons.length); // numIcons
      headerStream.writeDWord(-1); // dataOffset

      for(BNetIcon icon : icons) {
View Full Code Here

      BNetOutputStream headerStream = new BNetOutputStream(baos);
    ) {
      Out.debug(IconsDotBniReader.class, "Writing " + f.getName());

      headerStream.writeWord(1); // BNI version
      headerStream.writeWord(0); // Alignment Padding (unused)
      headerStream.writeDWord(icons.length); // numIcons
      headerStream.writeDWord(-1); // dataOffset

      for(BNetIcon icon : icons) {
        headerStream.writeDWord(icon.flags);
View Full Code Here

  public void sendPacket(OutputStream out) {
    byte data[] = ((ByteArrayOutputStream)this.out).toByteArray();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    try (BNetOutputStream sckout = new BNetOutputStream(baos)) {
      sckout.writeWord(data.length + 3);
      sckout.writeByte(packetId.ordinal());
      sckout.write(data);
    } catch(IOException e) {
      Out.fatalException(e);
    }
View Full Code Here

    if(GlobalSettings.packetLog) {
      String msg = "RECV " + packetId.name();
      if(Out.isDebug()) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try (BNetOutputStream os = new BNetOutputStream(baos)) {
          os.writeWord(packetLength);
          os.writeByte(packetId.ordinal());
          os.write(data);
        }
        msg += "\n" + HexDump.hexDump(baos.toByteArray());
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.