Exemplo n.º 1
0
        protected internal override void Encode(ChannelHandlerContext ctx, FileHeader msg, ByteBuf @out)
        {
            string name = msg.FileName();

            sbyte[] bytes = UTF8.encode(name);
            @out.writeInt(bytes.Length);
            @out.writeBytes(bytes);
            @out.writeInt(msg.RequiredAlignment());
        }
Exemplo n.º 2
0
 public static void Marshal(ByteBuf buffer, string @string)
 {
     if (string.ReferenceEquals(@string, null))
     {
         buffer.writeInt(NULL_STRING_LENGTH);
     }
     else
     {
         sbyte[] bytes = @string.GetBytes(UTF_8);
         buffer.writeInt(bytes.Length);
         buffer.writeBytes(bytes);
     }
 }
Exemplo n.º 3
0
        internal static ByteBuf SerializeTerms(RaftLogEntry[] raftLogEntries, ByteBufAllocator byteBufAllocator)
        {
            int     capacity = (sizeof(sbyte) * 8) + (sizeof(int) * 8) + (sizeof(long) * 8) * raftLogEntries.Length;
            ByteBuf buffer   = byteBufAllocator.buffer(capacity, capacity);

            buffer.writeByte(ContentType.RaftLogEntryTerms.get());
            buffer.writeInt(raftLogEntries.Length);
            foreach (RaftLogEntry raftLogEntry in raftLogEntries)
            {
                buffer.writeLong(raftLogEntry.Term());
            }
            return(buffer);
        }
Exemplo n.º 4
0
 protected internal override void Encode(ChannelHandlerContext ctx, TxStreamFinishedResponse response, ByteBuf @out)
 {
     @out.writeInt(response.Status().ordinal());
     @out.writeLong(response.LatestTxId());
 }
Exemplo n.º 5
0
 public override WritableChannel PutInt(int value)
 {
     @delegate.writeInt(value);
     return(this);
 }
Exemplo n.º 6
0
 protected internal override void Encode(ChannelHandlerContext ctx, StoreCopyFinishedResponse msg, ByteBuf @out)
 {
     @out.writeInt(msg.Status().ordinal());
 }
Exemplo n.º 7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.storageengine.api.WritableChannel putInt(int value) throws MessageTooBigException
        public override WritableChannel PutInt(int value)
        {
            CheckSize(Integer.BYTES);
            @delegate.writeInt(value);
            return(this);
        }