Package streamer

Examples of streamer.ByteBuffer.trimAtCursor()


        // request.negoTokens.tags[0]).negoToken.value);

        // Write request to buffer and compare with original
        ByteBuffer toWriteBuf = new ByteBuffer(packet.length + 100, true);
        request.writeTag(toWriteBuf);
        toWriteBuf.trimAtCursor();

        if (!toReadBuf.equals(toWriteBuf))
            throw new RuntimeException("Data written to buffer is not equal to data read from buffer. \nExpected: " + toReadBuf + "\nActual: " + toWriteBuf + ".");
    }
View Full Code Here


        // Body
        ByteBuffer buf = new ByteBuffer(1024, true);
        numberCapabilities = 0;
        writeCapabilities(buf);
        buf.trimAtCursor();

        // Header
        ByteBuffer header = createMCSHeader(buf);

        // Length of source descriptor, including NULL character (LE)
View Full Code Here

        header.writeShortLE(numberCapabilities);

        // Padding 2 bytes
        header.writeShortLE(0);

        header.trimAtCursor();

        // Prepend header to capabilities
        buf.prepend(header);

        // Trim buffer to actual length of data written
View Full Code Here

          (byte)0x32, (byte)0x00,
      });
      /* @formatter:on */

            // Trim buffer to actual length of data written
            buf.trimAtCursor();

            pushDataToPad(STDOUT, buf);
        }
    }

View Full Code Here

        (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
    });
    /* @formatter:on */

        // Trim buffer to actual length of data written
        buf.trimAtCursor();

        pushDataToPad(STDOUT, buf);
    }

    private void sendControlPDUActionCooperate() {
View Full Code Here

        // controlId: 0
        (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
    });
    /* @formatter:on */

        buf.trimAtCursor();

        pushDataToPad(STDOUT, buf);
    }

    private void sendSynchronizePDU() {
View Full Code Here

        (byte)0x01, (byte)0x00,
        // targetUser: 0x03ea
        (byte)0xea, (byte)0x03,
    });
    /* @formatter:on */
        buf.trimAtCursor();
        pushDataToPad(STDOUT, buf);
    }

    private void writeCapabilities(ByteBuffer buf) {
        writeGeneralCS(buf);
View Full Code Here

        tsRequest.pubKeyAuth.value = messageSignatureAndEncryptedServerPublicKey;

        tsRequest.writeTag(buf);

        // Trim buffer to actual length of data written
        buf.trimAtCursor();

        pushDataToOTOut(buf);

        switchOff();
    }
View Full Code Here

        // Copy subjectPublicKey subfield to separate byte buffer
        ByteBuffer subjectPublicKey = new ByteBuffer(subjectPublicKeyInfo.length);
        parser.subjectPublicKey.writeTag(subjectPublicKey);

        subjectPublicKeyInfo.unref();
        subjectPublicKey.trimAtCursor();

        // Skip tag:
        // 03 82 01 0f (tag) 00 (padding byte)
        subjectPublicKey.trimHeader(5);// FIXME: parse it properly
        // * DEBUG */System.out.println("DEBUG: subjectPublicKey:\n" +
View Full Code Here

        // cbAutoReconnectCookie: 0 bytes (LE)
        buf.writeShortLE(0);

        // Trim buffer to actual length of data written
        buf.trimAtCursor();

        pushDataToOTOut(buf);

        switchOff();
    }
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.