public DbValue AllocValue(mstring x) { List <byte> buf = AllocBuffer(1 + x.Length * 2); buf.Add(0); // Nullable; IsNull=false x.ToByteSliceUTF16().AppendTo(buf); return(AllocValue(ByteSlice.Prepare(buf), DbTypeID.CHARS)); }
public DbValue AllocValue(mstring x, int RowSizeBytes) { List <byte> buf = AllocBuffer(RowSizeBytes); buf.Add(0); // Nullable; IsNull=false x.ToByteSliceUTF16().AppendTo(buf); for (int i = buf.Count; i < RowSizeBytes; i++) { buf.Add(0); } return(AllocValue(ByteSlice.Prepare(buf), DbTypeID.CHARS)); }
public void PutString(mstring s, int length) { ByteSlice bs = s.ToByteSliceUTF16(); rs.PutByte(0); //front byte int totalsize = length * 2; int min = bs.Length < totalsize ? bs.Length : totalsize; for (int i = 0; i < min; i++) { rs.PutByte(bs[i]); } for (int i = min; i < totalsize; i++) { rs.PutByte(0); } }
public DbValue AllocValue(mstring x) { List<byte> buf = AllocBuffer(1 + x.Length * 2); buf.Add(0); // Nullable; IsNull=false x.ToByteSliceUTF16().AppendTo(buf); return AllocValue(ByteSlice.Prepare(buf), DbTypeID.CHARS); }
public DbValue AllocValue(mstring x, int RowSizeBytes) { List<byte> buf = AllocBuffer(RowSizeBytes); buf.Add(0); // Nullable; IsNull=false x.ToByteSliceUTF16().AppendTo(buf); for (int i = buf.Count; i < RowSizeBytes; i++) { buf.Add(0); } return AllocValue(ByteSlice.Prepare(buf), DbTypeID.CHARS); }