private byte[] ReadStringBytes() { var sizeBytes = _io.ReadBytes(IntSizeX2); var totalSize = ByteArrayConverter.ByteArrayToInt(sizeBytes); // Use offset of int size to read real size var stringSize = ByteArrayConverter.ByteArrayToInt(sizeBytes, OdbType.Integer.Size); var bytes = ReadBytes(stringSize); // Reads extra bytes ReadBytes(totalSize - stringSize); var bytes2 = new byte[stringSize + IntSizeX2]; for (var i = 0; i < IntSizeX2; i++) { bytes2[i] = sizeBytes[i]; } for (var i = 0; i < bytes.Length; i++) { bytes2[i + 8] = bytes[i]; } return(bytes2); }
public void WriteString(string s, bool writeInTransaction, int totalSpace) { var bytes = ByteArrayConverter.StringToByteArray(s, totalSpace); if (!writeInTransaction) { _io.WriteBytes(bytes); } else { _session.GetTransaction().ManageWriteAction(_io.CurrentPosition, bytes); EnsureSpaceFor(bytes.Length, OdbType.String); } }
public void WriteBigDecimal(Decimal d, bool writeInTransaction) { var bytes = ByteArrayConverter.DecimalToByteArray(d); if (!writeInTransaction) { _io.WriteBytes(bytes); } else { _session.GetTransaction().ManageWriteAction(_io.CurrentPosition, bytes); EnsureSpaceFor(bytes.Length, OdbType.Decimal); } }
public bool ReadBoolean() { return(ByteArrayConverter.ByteArrayToBoolean(ReadBooleanBytes())); }
public string ReadString() { return(ByteArrayConverter.ByteArrayToString(ReadStringBytes())); }
public DateTime ReadDate() { return(ByteArrayConverter.ByteArrayToDate(ReadDateBytes())); }
public Decimal ReadBigDecimal() { return(ByteArrayConverter.ByteArrayToDecimal(ReadBigDecimalBytes())); }
public double ReadDouble() { return(ByteArrayConverter.ByteArrayToDouble(ReadDoubleBytes())); }
public ulong ReadULong() { return(ByteArrayConverter.ByteArrayToULong(ReadULongBytes())); }
public float ReadFloat() { return(ByteArrayConverter.ByteArrayToFloat(ReadFloatBytes())); }
public long ReadLong() { return(ByteArrayConverter.ByteArrayToLong(ReadLongBytes())); }
public uint ReadUInt() { return(ByteArrayConverter.ByteArrayToUInt(ReadUIntBytes())); }
public int ReadInt() { return(ByteArrayConverter.ByteArrayToInt(ReadIntBytes())); }
public ushort ReadUShort() { return(ByteArrayConverter.ByteArrayToUShort(ReadUShortBytes())); }
public char ReadChar() { return(ByteArrayConverter.ByteArrayToChar(ReadCharBytes())); }