}
private void sendFontListPDU() {
{
int length = 1024; // Large enough
ByteBuffer buf = new ByteBuffer(length, true);
/* @formatter:off */
buf.writeBytes(new byte[] {
// MCS Send Data Request
(byte)0x64,
// Initiator: 1004 (1001+3)
(byte)0x00, (byte)0x03,
// Channel ID: 1003 (I/O channel)
(byte)0x03, (byte)0xeb,
// Data priority: high (0x40), segmentation: begin (0x20) | end (0x10)
(byte)0x70,
// User data length: 26 bytes (0x1a, variable length field)
(byte)0x80, (byte)0x1a,
// Total length: 26 bytes (0x1a, LE)
(byte)0x1a, (byte)0x00,
// PDU type: PDUTYPE_DATAPDU (0x7), PDU version: 1 (0x0010) (LE)
(byte)0x17, (byte)0x00,
// PDU source: 1004 (LE)
(byte)0xec, (byte)0x03,
});
// Share ID, 4 bytes (LE)
buf.writeIntLE((int)state.serverShareId);
buf.writeBytes(new byte[] {
// Padding 1 byte
(byte)0x00,
// Stream ID: STREAM_LOW (1)
(byte)0x01,
// uncompressedLength : 12 bytes (LE)
(byte)0x0c, (byte)0x00,
// pduType2: PDUTYPE2_FONTLIST (39)
(byte)0x27,
// generalCompressedType: 0
(byte)0x00,
// generalCompressedLength: 0 (LE)
(byte)0x00, (byte)0x00,
// numberEntries (should be set to zero): 0 (LE)
(byte)0x00, (byte)0x00,
// totalNumEntries (should be set to zero): 0 (LE)
(byte)0x00, (byte)0x00,
// listFlags (should be set to 0x3): 0x0003 (LE), FONTLIST_LAST(0x2) | FONTLIST_FIRST(0x1)
(byte)0x03, (byte)0x00,
// entrySize: 50 bytes (0x0032, LE)
(byte)0x32, (byte)0x00,
});
/* @formatter:on */
// Trim buffer to actual length of data written
buf.trimAtCursor();
pushDataToPad(STDOUT, buf);
}
}