Package net.bnubot.core

Examples of net.bnubot.core.BNetInputStream.readByte()


 
  public MCPPacketReader(InputStream rawis, boolean packetLog) throws IOException {
    BNetInputStream is = new BNetInputStream(rawis);
   
    packetLength = is.readWord() & 0x0000FFFF;
    packetId = is.readByte() & 0x000000FF;
    assert(packetLength >= 3);
   
    data = new byte[packetLength-3];
    for(int i = 0; i < packetLength-3; i++) {
      data[i] = is.readByte();
View Full Code Here


    packetId = is.readByte() & 0x000000FF;
    assert(packetLength >= 3);
   
    data = new byte[packetLength-3];
    for(int i = 0; i < packetLength-3; i++) {
      data[i] = is.readByte();
    }
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    BNetOutputStream os = new BNetOutputStream(baos);
    os.writeByte(packetId);
View Full Code Here

      //Pixel data
      int[] pixelData = new int[width*height];
      int currentPixel = 0;
     
      while(currentPixel < pixelData.length) {
        byte packetHeader = is.readByte()// if bit 7 (0x80) is set, run-length packet;
        int len = (packetHeader & 0x7F) + 1;
        if((packetHeader & 0x80) != 0) {
          //Run-length packet
          int blue = is.readByte() & 0xFF;
          int green = is.readByte() & 0xFF;
View Full Code Here

      while(currentPixel < pixelData.length) {
        byte packetHeader = is.readByte()// if bit 7 (0x80) is set, run-length packet;
        int len = (packetHeader & 0x7F) + 1;
        if((packetHeader & 0x80) != 0) {
          //Run-length packet
          int blue = is.readByte() & 0xFF;
          int green = is.readByte() & 0xFF;
          int red = is.readByte() & 0xFF;
          int col = new Color(red, green, blue).getRGB();
          for(int i = 0; i < len; i++)
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
View Full Code Here

        byte packetHeader = is.readByte()// if bit 7 (0x80) is set, run-length packet;
        int len = (packetHeader & 0x7F) + 1;
        if((packetHeader & 0x80) != 0) {
          //Run-length packet
          int blue = is.readByte() & 0xFF;
          int green = is.readByte() & 0xFF;
          int red = is.readByte() & 0xFF;
          int col = new Color(red, green, blue).getRGB();
          for(int i = 0; i < len; i++)
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
        } else {
View Full Code Here

        int len = (packetHeader & 0x7F) + 1;
        if((packetHeader & 0x80) != 0) {
          //Run-length packet
          int blue = is.readByte() & 0xFF;
          int green = is.readByte() & 0xFF;
          int red = is.readByte() & 0xFF;
          int col = new Color(red, green, blue).getRGB();
          for(int i = 0; i < len; i++)
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
        } else {
          for(int i = 0; i < len; i++) {
View Full Code Here

          int col = new Color(red, green, blue).getRGB();
          for(int i = 0; i < len; i++)
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
        } else {
          for(int i = 0; i < len; i++) {
            int blue = is.readByte() & 0xFF;
            int green = is.readByte() & 0xFF;
            int red = is.readByte() & 0xFF;
            int col = new Color(red, green, blue).getRGB();
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
          }
View Full Code Here

          for(int i = 0; i < len; i++)
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
        } else {
          for(int i = 0; i < len; i++) {
            int blue = is.readByte() & 0xFF;
            int green = is.readByte() & 0xFF;
            int red = is.readByte() & 0xFF;
            int col = new Color(red, green, blue).getRGB();
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
          }
        }
View Full Code Here

            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
        } else {
          for(int i = 0; i < len; i++) {
            int blue = is.readByte() & 0xFF;
            int green = is.readByte() & 0xFF;
            int red = is.readByte() & 0xFF;
            int col = new Color(red, green, blue).getRGB();
            pixelData[getRealPixelPosition(currentPixel++, height, width)] = col;
          }
        }
      }
View Full Code Here

        icons[i] = icon;
        //Out.info(this.getClass().getName(), icon.toString());
      }
     
      //Image in targa format
      byte infoLength = is.readByte();
      is.skip(1);              // ColorMapType
      byte imageType = is.readByte();    // run-length true-color image types = 0x0A
      is.skip(5);              // ColorMapSpecification - color map data
      is.skip(2)//int xOrigin = is.readWord();
      is.skip(2)//int yOrigin = is.readWord();
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.