**** Merged from MCS ****
[mono-project.git] / mcs / class / Npgsql / Npgsql / NpgsqlParameterStatus.cs
blob6df8f7ef285e5bbab722a19173d222f2bb937ff6
1 // created on 8/6/2003 at 13:57
2 // Npgsql.NpgsqlAsciiRow.cs
3 //
4 // Author:
5 // Francisco Jr. (fxjrlists@yahoo.com.br)
6 //
7 // Copyright (C) 2002 The Npgsql Development Team
8 // npgsql-general@gborg.postgresql.org
9 // http://gborg.postgresql.org/project/npgsql/projdisplay.php
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU Lesser General Public
13 // License as published by the Free Software Foundation; either
14 // version 2.1 of the License, or (at your option) any later version.
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with this library; if not, write to the Free Software
23 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 using System;
26 using System.Collections;
27 using System.IO;
28 using System.Text;
29 using System.Net;
30 using NpgsqlTypes;
33 namespace Npgsql
36 /// <summary>
37 /// This class represents the ParameterStatus message sent from PostgreSQL
38 /// server.
39 /// </summary>
40 ///
41 internal sealed class NpgsqlParameterStatus
44 private String _parameter;
45 private String _parameterValue;
48 public void ReadFromStream(Stream inputStream, Encoding encoding)
51 //Read message length
52 Byte[] inputBuffer = new Byte[4];
53 PGUtil.CheckedStreamRead(inputStream, inputBuffer, 0, 4 );
55 Int32 messageLength = IPAddress.NetworkToHostOrder(BitConverter.ToInt32(inputBuffer, 0));
57 _parameter = PGUtil.ReadString(inputStream, encoding);
58 _parameterValue = PGUtil.ReadString(inputStream, encoding);
63 public String Parameter
65 get
67 return _parameter;
71 public String ParameterValue
73 get
75 return _parameterValue;