¡@

Home 

c# Programming Glossary: buffer

Encrypt/Decrypt string in .NET

http://stackoverflow.com/questions/202011/encrypt-decrypt-string-in-net

Stream did not contain properly formatted byte array byte buffer new byte BitConverter.ToInt32 rawLength 0 if s.Read buffer 0.. buffer new byte BitConverter.ToInt32 rawLength 0 if s.Read buffer 0 buffer.Length buffer.Length throw new SystemException Did.. byte BitConverter.ToInt32 rawLength 0 if s.Read buffer 0 buffer.Length buffer.Length throw new SystemException Did not read..

Creating a byte array from a stream

http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream

like this public static byte ReadFully Stream input byte buffer new byte 16 1024 using MemoryStream ms new MemoryStream int.. ms new MemoryStream int read while read input.Read buffer 0 buffer.Length 0 ms.Write buffer 0 read return ms.ToArray.. new MemoryStream int read while read input.Read buffer 0 buffer.Length 0 ms.Write buffer 0 read return ms.ToArray EDIT I..

Best way to copy between two Stream instances

http://stackoverflow.com/questions/230128/best-way-to-copy-between-two-stream-instances

static void CopyStream Stream input Stream output byte buffer new byte 32768 int read while read input.Read buffer 0 buffer.Length.. byte buffer new byte 32768 int read while read input.Read buffer 0 buffer.Length 0 output.Write buffer 0 read share improve.. new byte 32768 int read while read input.Read buffer 0 buffer.Length 0 output.Write buffer 0 read share improve this answer..

How to read a text file reversely with iterator in C#

http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp

Classes with internal access can specify a different buffer size this is useful for testing. summary private const int DefaultBufferSize.. summary private readonly Encoding encoding summary Size of buffer in bytes to read each time we read from the stream. This must.. bytes for a single character. summary private readonly int bufferSize summary Function which when given a position within a file..

Proper use of the IDisposable interface

http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

i.e. the .NET managed Bitmap class as some sort of frame buffer Sure this is a managed .NET object and the garbage collector..

How do I access ARP-protocol information through .NET?

http://stackoverflow.com/questions/1148778/how-do-i-access-arp-protocol-information-through-net

fragment 0 reply.Options.DontFragment Console.WriteLine Buffer size 0 reply.Buffer.Length This is an example of the GetIpNetTable... Console.WriteLine Buffer size 0 reply.Buffer.Length This is an example of the GetIpNetTable. using System.. the memory pointer by the size of the int. IntPtr currentBuffer new IntPtr buffer.ToInt64 Marshal.SizeOf typeof int Allocate..

How can I upload a file and save it to a Stream for further preview using C#?

http://stackoverflow.com/questions/1653469/how-can-i-upload-a-file-and-save-it-to-a-stream-for-further-preview-using-c

Session pdf Response.ContentType application pdf Response.Buffer true Response.Clear Response.BinaryWrite imageByte But nothing.. put in the byte we've just read and continue byte newBuffer new byte buffer.Length 2 Array.Copy buffer newBuffer buffer.Length.. newBuffer new byte buffer.Length 2 Array.Copy buffer newBuffer buffer.Length newBuffer read byte nextByte buffer newBuffer..

File IO with Streams - Best Memory Buffer Size

http://stackoverflow.com/questions/3033771/file-io-with-streams-best-memory-buffer-size

IO with Streams Best Memory Buffer Size I am writing a small IO library to assist with a larger..

PBKDF2 in Bouncy Castle C#

http://stackoverflow.com/questions/3210795/pbkdf2-in-bouncy-castle-c-sharp

outOff j ^ state j private void IntToOctet byte Buffer int i Buffer 0 byte uint i 24 Buffer 1 byte uint i 16 Buffer.. j ^ state j private void IntToOctet byte Buffer int i Buffer 0 byte uint i 24 Buffer 1 byte uint i 16 Buffer 2 byte uint.. void IntToOctet byte Buffer int i Buffer 0 byte uint i 24 Buffer 1 byte uint i 16 Buffer 2 byte uint i 8 Buffer 3 byte i Use..

How to convert a structure to a byte array in C#?

http://stackoverflow.com/questions/3278827/how-to-convert-a-structure-to-a-byte-array-in-c

public int parametersStartIndex public ushort byteCount Buffer length public int bufferStartIndex public string Buffer In my.. Buffer length public int bufferStartIndex public string Buffer In my main method I create an instance of it and assign values.. 22 packet.wordCount 0 packet.byteCount 119 packet.Buffer NT LM 0.12 Now I want to send this Packet by socket. For that..

How to read a text file reversely with iterator in C#

http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp

sealed class ReverseLineReader IEnumerable string summary Buffer size to use by default. Classes with internal access can specify.. is useful for testing. summary private const int DefaultBufferSize 4096 summary Means of creating a Stream to read from. summary.. Encoding encoding this streamSource encoding DefaultBufferSize internal ReverseLineReader Func Stream streamSource Encoding..

Any faster way of copying arrays in C#?

http://stackoverflow.com/questions/5099604/any-faster-way-of-copying-arrays-in-c

c# arrays copy share improve this question Use Buffer.BlockCopy . Its entire purpose is to perform fast see Buffer.. . Its entire purpose is to perform fast see Buffer This class provides better performance for manipulating primitive.. out of the system if you bind a delegate to System.Buffer.memcpyimpl and call that directly. The signature is internal..

Download/Stream file from URL - asp.net

http://stackoverflow.com/questions/5596747/download-stream-file-from-url-asp-net

at a time and send to the client int bytesToRead 10000 Buffer to read bytes in chunk size specified above byte buffer new..

How would you code an efficient Circular Buffer in Java or C#

http://stackoverflow.com/questions/590069/how-would-you-code-an-efficient-circular-buffer-in-java-or-c-sharp

would you code an efficient Circular Buffer in Java or C# I want a simple class that implements a fixed.. to the user Hijack these for simplicity import java.nio.BufferOverflowException import java.nio.BufferUnderflowException public.. import java.nio.BufferOverflowException import java.nio.BufferUnderflowException public class CircularBuffer T private T buffer..

Using C#, how does one figure out what process locked a file?

http://stackoverflow.com/questions/860656/using-c-how-does-one-figure-out-what-process-locked-a-file

ipTemp new IntPtr Convert.ToInt64 objObjectType.Name.Buffer.ToString 10 32 else ipTemp objObjectType.Name.Buffer var.. 10 32 else ipTemp objObjectType.Name.Buffer var strObjectTypeName Marshal.PtrToStringUni ipTemp objObjectType.Name.Length.. ipTemp new IntPtr Convert.ToInt64 objObjectName.Name.Buffer.ToString 10 32 else ipTemp objObjectName.Name.Buffer if..

How to AES-128 encrypt a string using a password in Delphi and decrypt in C#?

http://stackoverflow.com/questions/9188045/how-to-aes-128-encrypt-a-string-using-a-password-in-delphi-and-decrypt-in-c

hKey HCRYPTKEY lul_datalen Integer lul_buflen Integer Buffer TBytes begin Assert Password '' if Value '' then Result '' else.. allocate buffer space lul_datalen Length Value SizeOf Char Buffer TEncoding.Unicode.GetBytes Value ' ' lul_buflen Length Buffer.. TEncoding.Unicode.GetBytes Value ' ' lul_buflen Length Buffer encrypt to buffer Win32Check CryptEncrypt hKey 0 True 0 @Buffer..

How to detect if machine is joined to domain (in C#)?

http://stackoverflow.com/questions/926227/how-to-detect-if-machine-is-joined-to-domain-in-c

null out pDomain out status if pDomain IntPtr.Zero NetApiBufferFree pDomain if result Win32.ErrorSuccess if status Win32.NetJoinStatus.NetSetupDomainName.. DllImport Netapi32.dll public static extern int NetApiBufferFree IntPtr Buffer public enum NetJoinStatus NetSetupUnknownStatus.. public static extern int NetApiBufferFree IntPtr Buffer public enum NetJoinStatus NetSetupUnknownStatus 0 NetSetupUnjoined..

how to write super fast file streaming code in C#?

http://stackoverflow.com/questions/955911/how-to-write-super-fast-file-streaming-code-in-c

Reader i.e. without actually loading the contents into the Buffer in memory c# performance streaming cpu utilization share.. easiest way to do that would probably be to introduce a BufferedStream wrapping the input stream. share improve this answer..