/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// Note! flags, cmdSet, and cmd are all byte values.
// We represent them as shorts to make them easier
// to work with.
int id;
short flags;
short cmdSet;
short cmd;
short errorCode;
byte[] data;
volatile boolean replied = false;
/**
* Return byte representation of the packet
*/
public byte[] toByteArray() {
byte b[] = new byte[len];
b[8] = (byte)flags;
b[9] = (byte)cmdSet;
b[10] = (byte)cmd;
} else {
}
}
return b;
}
/**
* Create a packet from its byte array representation
*/
if (b.length < 11) {
throw new IOException("packet is insufficient size");
}
throw new IOException("length size mis-match");
}
} else {
}
return p;
}
Packet()
{
}
static synchronized private int uniqID()
{
/*
* JDWP spec does not require this id to be sequential and
* increasing, but our implementation does. See
* VirtualMachine.notifySuspend, for example.
*/
return uID++;
}
}