Refactored a few for ReadBufferState.cs

This commit is contained in:
sta 2015-04-06 14:56:28 +09:00
parent e113e842d3
commit c21db7ea64

View File

@ -43,16 +43,26 @@ namespace WebSocketSharp.Net
{ {
internal class ReadBufferState internal class ReadBufferState
{ {
#region Private Fields
private HttpStreamAsyncResult _asyncResult;
private byte[] _buffer;
private int _count;
private int _initialCount;
private int _offset;
#endregion
#region Public Constructors #region Public Constructors
public ReadBufferState ( public ReadBufferState (
byte [] buffer, int offset, int count, HttpStreamAsyncResult asyncResult) byte[] buffer, int offset, int count, HttpStreamAsyncResult asyncResult)
{ {
Buffer = buffer; _buffer = buffer;
Offset = offset; _offset = offset;
Count = count; _count = count;
InitialCount = count; _initialCount = count;
AsyncResult = asyncResult; _asyncResult = asyncResult;
} }
#endregion #endregion
@ -60,23 +70,53 @@ namespace WebSocketSharp.Net
#region Public Properties #region Public Properties
public HttpStreamAsyncResult AsyncResult { public HttpStreamAsyncResult AsyncResult {
get; set; get {
return _asyncResult;
}
set {
_asyncResult = value;
}
} }
public byte [] Buffer { public byte[] Buffer {
get; set; get {
return _buffer;
}
set {
_buffer = value;
}
} }
public int Count { public int Count {
get; set; get {
return _count;
}
set {
_count = value;
}
} }
public int InitialCount { public int InitialCount {
get; set; get {
return _initialCount;
}
set {
_initialCount = value;
}
} }
public int Offset { public int Offset {
get; set; get {
return _offset;
}
set {
_offset = value;
}
} }
#endregion #endregion