public Read ( byte buffer, int offset, int count ) : int | ||
buffer | byte | |
offset | int | |
count | int | |
Résultat | int |
public override int Read(byte[] buffer, int offset, int count) { do { if (dataLength != 0) { int readLen = (dataLength > count || dataLength < 0) ? count : dataLength; int len = m_in.Read(buffer, offset, readLen); if (len < 1) { throw new EndOfStreamException("Premature end of stream in PartialInputStream"); } dataLength -= len; return(len); } }while (partial && ReadPartialDataLength() >= 0); return(0); }
public override int Read(byte[] buffer, int offset, int count) { if (dataLength > 0) { int len = m_in.Read(buffer, offset, System.Math.Min(dataLength, count)); if (len < 1) { throw new IOException("Premature end of stream in PartialInputStream"); } dataLength -= len; return(len); } if (partial && ReadPartialDataLength() >= 0) { return(this.Read(buffer, offset, count)); } return(0); }
public override int Read(byte[] buffer, int offset, int count) { do { if (_dataLength == 0) { continue; } var readLen = (_dataLength > count || _dataLength < 0) ? count : _dataLength; var len = _in.Read(buffer, offset, readLen); if (len < 1) { throw new EndOfStreamException("Premature end of stream in PartialInputStream"); } _dataLength -= len; return(len); }while (_partial && ReadPartialDataLength() >= 0); return(0); }