public int write(byte[] destMac,byte[] packet,int offset,int byteCount){
  if (destMac == null) {
    throw new NullPointerException("destMac == null");
  }
  if (packet == null) {
    throw new NullPointerException("packet == null");
  }
  Arrays.checkOffsetAndCount(packet.length,offset,byteCount);
  if (destMac.length != 6) {
    throw new IllegalArgumentException("MAC length must be 6: " + destMac.length);
  }
  return sendPacket(fd,mInterfaceName,mProtocolType,destMac,packet,offset,byteCount);
}

public int write ( byte [ ] destMac , byte [ ] packet , int offset , int byteCount ) { if ( destMac == null ) { throw new NullPointerException ( "destMac == null" ) ; } if ( packet == null ) { throw new NullPointerException ( "packet == null" ) ; } Arrays . checkOffsetAndCount ( packet . length , offset , byteCount ) ; if ( destMac . length != 6 ) { throw new IllegalArgumentException ( "MAC length must be 6: " + destMac . length ) ; } return sendPacket ( fd , mInterfaceName , mProtocolType , destMac , packet , offset , byteCount ) ; }
writes a raw packet to the desired interface . a l2 header will be added which includes the specified destination address , our source mac , and the specified protocol type . the caller is responsible for computing correct ip - header and payload checksums .
