Exemple #1
0
        /// <summary>
        ///     Encodes this index into a byte buffer.
        /// </summary>
        /// <returns> The buffer. </returns>
        public ByteBuffer Encode()
        {
            var buf = ByteBuffer.allocate(SIZE);

            ByteBufferExtensions.PutTriByte(buf, size);
            ByteBufferExtensions.PutTriByte(buf, sector);
            return((ByteBuffer)buf.flip());
        }
Exemple #2
0
        /// <summary>
        ///     Encodes this sector into a <seealso cref="ByteBuffer" />.
        /// </summary>
        /// <returns> The encoded buffer. </returns>
        public ByteBuffer Encode()
        {
            var buf = ByteBuffer.allocate(SIZE);

            buf.putShort((short)id);
            buf.putShort((short)chunk);
            ByteBufferExtensions.PutTriByte(buf, nextSector);
            buf.put((byte)type);
            buf.put(data);

            return((ByteBuffer)buf.flip());
        }