Package net.bnubot.core

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


      }
     
      //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();
      int width = is.readWord();
      int height = is.readWord();
View Full Code Here


      is.skip(5);              // ColorMapSpecification - color map data
      is.skip(2)//int xOrigin = is.readWord();
      is.skip(2)//int yOrigin = is.readWord();
      int width = is.readWord();
      int height = is.readWord();
      byte depth = is.readByte();      // 24 bit depth is good
      /*byte descriptor =*/ is.readByte()// bits 5 and 4 (00110000) specify the corner to start coloring pixels - 00=bl, 01=br, 10=tl, 11=tr
      is.skip(infoLength)//String info = is.readFixedLengthString(infoLength);
     
      if(imageType != 0x0A)
        throw new Exception("Unknown image type");
View Full Code Here

      is.skip(2)//int xOrigin = is.readWord();
      is.skip(2)//int yOrigin = is.readWord();
      int width = is.readWord();
      int height = is.readWord();
      byte depth = is.readByte();      // 24 bit depth is good
      /*byte descriptor =*/ is.readByte()// bits 5 and 4 (00110000) specify the corner to start coloring pixels - 00=bl, 01=br, 10=tl, 11=tr
      is.skip(infoLength)//String info = is.readFixedLengthString(infoLength);
     
      if(imageType != 0x0A)
        throw new Exception("Unknown image type");
      if(depth != 24)
View Full Code Here

  public BNCSPacketReader(InputStream rawis, boolean packetLog) throws IOException {
    BNetInputStream is = new BNetInputStream(rawis);
   
    byte magic;
    do {
      magic = is.readByte();
    } while(magic != (byte)0xFF);
   
    packetId = is.readByte() & 0x000000FF;
    packetLength = is.readWord() & 0x0000FFFF;
    assert(packetLength >= 4);
View Full Code Here

    byte magic;
    do {
      magic = is.readByte();
    } while(magic != (byte)0xFF);
   
    packetId = is.readByte() & 0x000000FF;
    packetLength = is.readWord() & 0x0000FFFF;
    assert(packetLength >= 4);
   
    data = new byte[packetLength-4];
    for(int i = 0; i < packetLength-4; i++) {
View Full Code Here

    packetLength = is.readWord() & 0x0000FFFF;
    assert(packetLength >= 4);
   
    data = new byte[packetLength-4];
    for(int i = 0; i < packetLength-4; i++) {
      data[i] = is.readByte();
    }
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    BNetOutputStream os = new BNetOutputStream(baos);
    os.writeByte(0xFF);
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.