DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Static Public Member Functions | List of all members
Deveel.Data.Store.AreaExtensions Class Reference

Extension methods to optimize the access to the contents of an IArea of a database store. More...

Static Public Member Functions

static byte ReadByte (this IArea area)
 Reads a single byte from the area. More...
 
static short ReadInt2 (this IArea area)
 Reads a 2-byte integer from the area. More...
 
static int ReadInt4 (this IArea area)
 Reads a 4-byte integer from the area. More...
 
static long ReadInt8 (this IArea area)
 Reads a 8-byte integer from the area. More...
 
static void WriteByte (this IArea area, byte value)
 Writes a single byte into the given area. More...
 
static void WriteInt2 (this IArea area, short value)
 Writes a 2-byte integer into the given area. More...
 
static void WriteInt4 (this IArea area, int value)
 Writes a 4-byte integer into the given area. More...
 
static void WriteInt8 (this IArea area, long value)
 Writes a 8-byte integer into the given area. More...
 

Detailed Description

Extension methods to optimize the access to the contents of an IArea of a database store.

Definition at line 24 of file AreaExtensions.cs.

Member Function Documentation

static byte Deveel.Data.Store.AreaExtensions.ReadByte ( this IArea  area)
inlinestatic

Reads a single byte from the area.

Parameters
areaThe source area from where to read.
Returns
Returns a byte read from the area.

Definition at line 32 of file AreaExtensions.cs.

32  {
33  var bytes = new byte[1];
34  area.Read(bytes, 0, 1);
35  return bytes[0];
36  }
static short Deveel.Data.Store.AreaExtensions.ReadInt2 ( this IArea  area)
inlinestatic

Reads a 2-byte integer from the area.

Parameters
areaThe source area from where to read.
Returns
Returns a short read from the area.

Definition at line 45 of file AreaExtensions.cs.

45  {
46  var bytes = new byte[2];
47  area.Read(bytes, 0, 2);
48  return BitConverter.ToInt16(bytes, 0);
49  }
static int Deveel.Data.Store.AreaExtensions.ReadInt4 ( this IArea  area)
inlinestatic

Reads a 4-byte integer from the area.

Parameters
areaThe source area from where to read.
Returns
Returns a int read from the area.

Definition at line 58 of file AreaExtensions.cs.

58  {
59  var bytes = new byte[4];
60  area.Read(bytes, 0, 4);
61  return BitConverter.ToInt32(bytes, 0);
62  }
static long Deveel.Data.Store.AreaExtensions.ReadInt8 ( this IArea  area)
inlinestatic

Reads a 8-byte integer from the area.

Parameters
areaThe source area from where to read.
Returns
Returns a long read from the area.

Definition at line 71 of file AreaExtensions.cs.

71  {
72  var bytes = new byte[8];
73  area.Read(bytes, 0, 8);
74  return BitConverter.ToInt64(bytes, 0);
75  }
static void Deveel.Data.Store.AreaExtensions.WriteByte ( this IArea  area,
byte  value 
)
inlinestatic

Writes a single byte into the given area.

Parameters
areaThe destination area where to write.
valueThe value to be written.

Definition at line 82 of file AreaExtensions.cs.

82  {
83  var bytes = new byte[1] {value};
84  area.Write(bytes, 0, 1);
85  }
static void Deveel.Data.Store.AreaExtensions.WriteInt2 ( this IArea  area,
short  value 
)
inlinestatic

Writes a 2-byte integer into the given area.

Parameters
areaThe destination area where to write.
valueThe value to be written.

Definition at line 92 of file AreaExtensions.cs.

92  {
93  var bytes = BitConverter.GetBytes(value);
94  area.Write(bytes, 0, 2);
95  }
static void Deveel.Data.Store.AreaExtensions.WriteInt4 ( this IArea  area,
int  value 
)
inlinestatic

Writes a 4-byte integer into the given area.

Parameters
areaThe destination area where to write.
valueThe value to be written.

Definition at line 102 of file AreaExtensions.cs.

102  {
103  var bytes = BitConverter.GetBytes(value);
104  area.Write(bytes, 0, 4);
105  }
static void Deveel.Data.Store.AreaExtensions.WriteInt8 ( this IArea  area,
long  value 
)
inlinestatic

Writes a 8-byte integer into the given area.

Parameters
areaThe destination area where to write.
valueThe value to be written.

Definition at line 112 of file AreaExtensions.cs.

112  {
113  var bytes = BitConverter.GetBytes(value);
114  area.Write(bytes, 0, 8);
115  }

The documentation for this class was generated from the following file: