DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Configuration.UrlConfigSource.WebOutputStream Class Reference
Inheritance diagram for Deveel.Data.Configuration.UrlConfigSource.WebOutputStream:

Public Member Functions

 WebOutputStream (Uri url)
 
override void Flush ()
 
override long Seek (long offset, SeekOrigin origin)
 
override void SetLength (long value)
 
override int Read (byte[] buffer, int offset, int count)
 
override void Write (byte[] buffer, int offset, int count)
 
override void Close ()
 

Properties

override bool CanRead [get]
 
override bool CanSeek [get]
 
override bool CanWrite [get]
 
override long Length [get]
 
override long Position [get, set]
 

Private Member Functions

void AssertNotClosed ()
 

Private Attributes

readonly Uri url
 
readonly MemoryStream baseStream
 
bool closed
 

Detailed Description

Definition at line 53 of file UrlConfigSource.cs.

Constructor & Destructor Documentation

Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.WebOutputStream ( Uri  url)
inline

Definition at line 58 of file UrlConfigSource.cs.

58  {
59  this.url = url;
60  baseStream = new MemoryStream(1024);
61  }

Member Function Documentation

void Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.AssertNotClosed ( )
inlineprivate

Definition at line 63 of file UrlConfigSource.cs.

63  {
64  if (closed)
65  throw new IOException("The stream is closed and cannot be written.");
66  }
override void Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.Close ( )
inline

Definition at line 143 of file UrlConfigSource.cs.

143  {
144  try {
145  baseStream.Close();
146  base.Close();
147  } finally {
148  closed = true;
149  }
150  }
override void Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.Flush ( )
inline

Definition at line 68 of file UrlConfigSource.cs.

68  {
70 
71  lock (baseStream) {
72  baseStream.Flush();
73 
74  var data = baseStream.ToArray();
75  using (var client = new WebClient()) {
76  client.UploadData(url, data);
77  }
78  }
79  }
override int Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.Read ( byte[]  buffer,
int  offset,
int  count 
)
inline

Definition at line 97 of file UrlConfigSource.cs.

97  {
98  throw new NotSupportedException();
99  }
override long Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.Seek ( long  offset,
SeekOrigin  origin 
)
inline

Definition at line 81 of file UrlConfigSource.cs.

81  {
83 
84  lock (baseStream) {
85  return baseStream.Seek(offset, origin);
86  }
87  }
override void Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.SetLength ( long  value)
inline

Definition at line 89 of file UrlConfigSource.cs.

89  {
91 
92  lock (baseStream) {
93  baseStream.SetLength(value);
94  }
95  }
override void Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.Write ( byte[]  buffer,
int  offset,
int  count 
)
inline

Definition at line 101 of file UrlConfigSource.cs.

101  {
102  AssertNotClosed();
103 
104  lock (baseStream) {
105  baseStream.Write(buffer, offset, count);
106  }
107  }

Member Data Documentation

readonly MemoryStream Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.baseStream
private

Definition at line 55 of file UrlConfigSource.cs.

bool Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.closed
private

Definition at line 56 of file UrlConfigSource.cs.

readonly Uri Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.url
private

Definition at line 54 of file UrlConfigSource.cs.

Property Documentation

override bool Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.CanRead
get

Definition at line 109 of file UrlConfigSource.cs.

override bool Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.CanSeek
get

Definition at line 113 of file UrlConfigSource.cs.

override bool Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.CanWrite
get

Definition at line 117 of file UrlConfigSource.cs.

override long Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.Length
get

Definition at line 121 of file UrlConfigSource.cs.

override long Deveel.Data.Configuration.UrlConfigSource.WebOutputStream.Position
getset

Definition at line 129 of file UrlConfigSource.cs.


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