title: Sending hex as byte to a printer
body: <p>I'm trying to write to a Brother label printer, even Brother supplies a SDK they do not have a newsroom for developers and the support are send to the regular printer support. </p>
  
  <p>I have to send the following hex 1b, 69, 7a, 84, 00 as one of many lines.</p>
  
  <p>I tried to do the following but I get an error on the hex 84 saying not a byte. I did a print to file from Brothers label program to view it in a hex editor and the hex editor shows 1B 69 7A 84 00</p>
  
  <pre><code>final ArrayList&lt;Byte&gt; commands = new ArrayList&lt;Byte&gt;();
  Byte[] printinfoCommand = new Byte[] {0x1b, 0x69, 0x7a, 0x84, 0x00];
  AddRange(commands, printinfoCommand);
  byte[] commandToSendToPrinter = convertFromListByteArrayTobyteArray(commands);
  myPrinter.writeBytes(commandToSendToPrinter);
  
  public static void AddRange(ArrayList&lt;Byte&gt; array, Byte[] newData) {
      for(int index=0; index&lt;newData.length; index++) {
          array.add(newData[index]);
      }
  }
  </code></pre>