static private ReadFully ( Stream stream, byte buffer, int offset, int count ) : void | ||
stream | Stream | Stream to read from |
buffer | byte | Array to store bytes read from the stream |
offset | int | The offset in buffer at which to begin storing the data read from the current stream. |
count | int | Number of bytes to read |
return | void |
private void ReadNextPacket(int len) { inBuffer = inBufferRef.Target as byte[]; if (inBuffer == null || inBuffer.Length < len) { inBuffer = new byte[len]; } MySqlStream.ReadFully(baseStream, inBuffer, 0, len); }
private void ReadNextPacket(int len) { if (!Platform.IsMono()) { this.inBuffer = (this.inBufferRef.Target as byte[]); } if (this.inBuffer == null || this.inBuffer.Length < len) { this.inBuffer = new byte[len]; } MySqlStream.ReadFully(this.baseStream, this.inBuffer, 0, len); }
// Read MySQL packet // since SSPI blobs data cannot be larger than ~12K, // handling just single packet is sufficient private byte[] ReadData() { byte[] buffer; MySqlStream.ReadFully(stream, packetHeader, 0, 4); int length = (int)(packetHeader[0] + (packetHeader[1] << 8) + (packetHeader[2] << 16)); seq = packetHeader[3] + 1; buffer = new byte[length]; MySqlStream.ReadFully(stream, buffer, 0, length); return(buffer); }
private void PrepareNextPacket() { MySqlStream.ReadFully(this.baseStream, this.lengthBytes, 0, 7); int num = (int)this.lengthBytes[0] + ((int)this.lengthBytes[1] << 8) + ((int)this.lengthBytes[2] << 16); int num2 = (int)this.lengthBytes[4] + ((int)this.lengthBytes[5] << 8) + ((int)this.lengthBytes[6] << 16); if (num2 == 0) { num2 = num; this.zInStream = null; } else { this.ReadNextPacket(num); MemoryStream in_Renamed = new MemoryStream(this.inBuffer); this.zInStream = new ZInputStream(in_Renamed); this.zInStream.maxInput = (long)num; } this.inPos = 0; this.maxInPos = num2; }
private void PrepareNextPacket() { MySqlStream.ReadFully(baseStream, lengthBytes, 0, 7); int compressedLength = lengthBytes[0] + (lengthBytes[1] << 8) + (lengthBytes[2] << 16); // lengthBytes[3] is seq int unCompressedLength = lengthBytes[4] + (lengthBytes[5] << 8) + (lengthBytes[6] << 16); if (unCompressedLength == 0) { unCompressedLength = compressedLength; compInStream = null; } else { ReadNextPacket(compressedLength); MemoryStream ms = new MemoryStream(inBuffer, 2, compressedLength - 2); compInStream = new DeflateStream(ms, CompressionMode.Decompress); } inPos = 0; maxInPos = unCompressedLength; }
public void LoadPacket() { try { this.packet.Length = 0; int num = 0; int num2; do { MySqlStream.ReadFully(this.inStream, this.packetHeader, 0, 4); this.sequenceByte = (byte)(this.packetHeader[3] + 1); num2 = (int)this.packetHeader[0] + ((int)this.packetHeader[1] << 8) + ((int)this.packetHeader[2] << 16); this.packet.Length += num2; MySqlStream.ReadFully(this.inStream, this.packet.Buffer, num, num2); num += num2; }while (num2 >= this.maxBlockSize); this.packet.Position = 0; } catch (IOException inner) { throw new MySqlException(Resources.ReadFromStreamFailed, true, inner); } }
private void PrepareNextPacket() { MySqlStream.ReadFully(baseStream, lengthBytes, 0, 7); int compressedLength = lengthBytes[0] + (lengthBytes[1] << 8) + (lengthBytes[2] << 16); // lengthBytes[3] is seq int unCompressedLength = lengthBytes[4] + (lengthBytes[5] << 8) + (lengthBytes[6] << 16); if (unCompressedLength == 0) { unCompressedLength = compressedLength; zInStream = null; } else { ReadNextPacket(compressedLength); MemoryStream ms = new MemoryStream(inBuffer); zInStream = new ZInputStream(ms); zInStream.maxInput = compressedLength; } inPos = 0; maxInPos = unCompressedLength; }