Here are the examples of the csharp api class System.Data.Common.DbDataReader.GetBytes(int, long, byte[], int, int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
21 Examples
0
1. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return InnerReader.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
2. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return InnerDataReader.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
3. Example
View licensepublic override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferOffset, int length) { return reader.GetBytes(i, fieldOffset, buffer, bufferOffset, length); }
0
4. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return source.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
5. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return source.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
6. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return source.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
7. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return source.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
8. Example
View licensevirtual public Stream GetStream(int ordinal) { using (MemoryStream bufferStream = new MemoryStream()) { long bytesRead = 0; long bytesReadTotal = 0; byte[] buffer = new byte[4096]; do { bytesRead = GetBytes(ordinal, bytesReadTotal, buffer, 0, buffer.Length); bufferStream.Write(buffer, 0, (int)bytesRead); bytesReadTotal += bytesRead; } while (bytesRead > 0); return new MemoryStream(bufferStream.ToArray(), false); } }
0
9. Example
View licensepublic override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { return rs.GetBytes(i, fieldOffset, buffer, bufferoffset, length); }
0
10. Example
View licensepublic override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { return reader.GetBytes(i, fieldOffset, buffer, bufferoffset, length); }
0
11. Example
View licensepublic override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { return _reader.GetBytes(i, fieldOffset, buffer, bufferoffset, length); }
0
12. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return _reader.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
13. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return wrappedReader.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
14. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { return _resultsReader.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
15. Example
View licensepublic override int Read(byte[] buffer, int offset, int count) { //This will throw with the same parameter names if the parameters are not valid. ValidateReadParameters(buffer, offset, count); try { int length = Math.Min(count, (int)(totalBytes - position)); long bytesRead = 0; if(length > 0) { bytesRead = reader.GetBytes(ordinal, position, buffer, offset, length); position += bytesRead; } return (int)bytesRead; } catch(DbException dex) { //It's not OK to throw non-IOExceptions from a Stream. throw new IOException(dex.Message, dex); } }
0
16. Example
View licensestatic int ReadBinaryBlob (DbDataReader reader, int column, ref byte[] buffer) { #if NETSTANDARD buffer = reader.GetFieldValue<byte[]> (column); return (int) buffer.Length; #else long nread; // first, get the length of the buffer needed if ((nread = reader.GetBytes (column, 0, null, 0, buffer.Length)) > buffer.Length) Array.Resize (ref buffer, (int) nread); // read the certificate data return (int) reader.GetBytes (column, 0, buffer, 0, (int) nread); #endif }
0
17. Example
View licensepublic override Guid GetGuid(int ordinal) { var value = GetValue(ordinal); if (value == null) return Guid.Empty; if (value is Byte[]) { var buffer = (Byte[])value; source.GetBytes(ordinal, 0, buffer, 0, 16); return new Guid(buffer); } if (value is string) return new Guid((string) value); return Guid.Empty; }
0
18. Example
View licensepublic override object Get(DbDataReader rs, int index, ISessionImplementor session) { int length = (int) rs.GetBytes(index, 0, null, 0, 0); byte[] buffer = new byte[length]; if (length > 0) { // The "if" is to make happy MySQL NH-2096 rs.GetBytes(index, 0, buffer, 0, length); } return ToExternalFormat(buffer); }
0
19. Example
View licensepublic override int Read(byte[] buffer, int offset, int count) { //This will throw with the same parameter names if the parameters are not valid. ValidateReadParameters(buffer, offset, count); try { int length = Math.Min(count, (int)(totalBytes - position)); long bytesRead = 0; if(length > 0) { bytesRead = reader.GetBytes(ordinal, position, buffer, offset, length); position += bytesRead; } return (int)bytesRead; } catch(DbException dex) { //It's not OK to throw non-IOExceptions from a Stream. throw new IOException(dex.Message, dex); } }
0
20. Example
View licensepublic override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) { WaitForReaderOrThrow(); ThrowIfPseudoColumnReference(ordinal); return this.GetCurrentDataReader().GetBytes(ordinal, dataOffset, buffer, bufferOffset, length); }
0
21. Example
View licenseprivate static async Task FlushSqlResultsToStream(DbDataReader reader, Stream stream, CancellationTo/n ..... /n //View Source file for more details /n }