6

Once I know what this means, there's probably a better way of expressing this question, but I don't know where to start.

Here's the Read method for a StreamReader:

public override int Read([In, Out] char[] buffer, int index, int count) { ... }

That "In, Out" bit - what is it for, what does it do, what's it called?

Party Ark
  • 1,061
  • 9
  • 20
  • 1
    I don't get the purpose of them in this context. Aren't they just used for p/invoke and marshalling? So why are they on a normal overriding method? – CodesInChaos Feb 27 '13 at 11:08

1 Answers1

4

That "In, Out" bit - what is it for, what does it do, what's it called?

They are parameter attributes.

In this case System.Runtime.InteropServices.InAttribute and System.Runtime.InteropServices.OutAttribute which are used for interop with code outside the .NET runtime.

Richard
  • 106,783
  • 21
  • 203
  • 265
  • Thank you. It would be worth changing the name of the question to make it more useful to people I think - any suggestions? (The Hokey-Cokey modifier springs to mind...) – Party Ark Feb 27 '13 at 11:05