-
Notifications
You must be signed in to change notification settings - Fork 2
/
IUserDefinedFileAttributeView.xml
391 lines (391 loc) · 27.6 KB
/
IUserDefinedFileAttributeView.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<Type Name="IUserDefinedFileAttributeView" FullName="Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView">
<TypeSignature Language="C#" Value="public interface IUserDefinedFileAttributeView : IDisposable, Java.Interop.IJavaPeerable, Java.Nio.FileNio.Attributes.IFileAttributeView" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit IUserDefinedFileAttributeView implements class Android.Runtime.IJavaObject, class Java.Interop.IJavaPeerable, class Java.Nio.FileNio.Attributes.IAttributeView, class Java.Nio.FileNio.Attributes.IFileAttributeView, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView" />
<TypeSignature Language="F#" Value="type IUserDefinedFileAttributeView = interface
 interface IFileAttributeView
 interface IAttributeView
 interface IJavaObject
 interface IDisposable
 interface IJavaPeerable" />
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Android.Runtime.IJavaObject</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Interop.IJavaPeerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Nio.FileNio.Attributes.IAttributeView</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Nio.FileNio.Attributes.IFileAttributeView</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("java/nio/file/attribute/UserDefinedFileAttributeView", "", "Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("java/nio/file/attribute/UserDefinedFileAttributeView", "", "Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker", ApiSince=26)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>A file attribute view that provides a view of a file's user-defined
attributes, sometimes known as <em>extended attributes</em>.</summary>
<remarks>
<para>A file attribute view that provides a view of a file's user-defined
attributes, sometimes known as <em>extended attributes</em>. User-defined
file attributes are used to store metadata with a file that is not meaningful
to the file system. It is primarily intended for file system implementations
that support such a capability directly but may be emulated. The details of
such emulation are highly implementation specific and therefore not specified.</para>
<para>This <c>FileAttributeView</c> provides a view of a file's user-defined
attributes as a set of name/value pairs, where the attribute name is
represented by a <c>String</c>. An implementation may require to encode and
decode from the platform or file system representation when accessing the
attribute. The value has opaque content. This attribute view defines the
<c>#read read</c> and <c>#write write</c> methods to read the value into
or write from a <c>ByteBuffer</c>. This <c>FileAttributeView</c> is not
intended for use where the size of an attribute value is larger than <c>Integer#MAX_VALUE</c>.</para>
<para>User-defined attributes may be used in some implementations to store
security related attributes so consequently, in the case of the default
provider at least, all methods that access user-defined attributes require the
<c>RuntimePermission("accessUserDefinedAttributes")</c> permission when a
security manager is installed.</para>
<para>The <c>java.nio.file.FileStore#supportsFileAttributeView
supportsFileAttributeView</c> method may be used to test if a specific <c>java.nio.file.FileStore FileStore</c> supports the storage of user-defined
attributes.</para>
<para>Where dynamic access to file attributes is required, the <c>java.nio.file.Files#getAttribute getAttribute</c> method may be used to read
the attribute value. The attribute value is returned as a byte array (byte[]).
The <c>java.nio.file.Files#setAttribute setAttribute</c> method may be used
to write the value of a user-defined attribute from a buffer (as if by
invoking the <c>#write write</c> method), or byte array (byte[]).</para>
<para>Added in 1.7.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/UserDefinedFileAttributeView" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.UserDefinedFileAttributeView</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
<Members>
<Member MemberName="Delete">
<MemberSignature Language="C#" Value="public void Delete (string? name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Delete(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView.Delete(System.String)" />
<MemberSignature Language="F#" Value="abstract member Delete : string -> unit" Usage="iUserDefinedFileAttributeView.Delete name" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("delete", "(Ljava/lang/String;)V", "GetDelete_Ljava_lang_String_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("delete", "(Ljava/lang/String;)V", "GetDelete_Ljava_lang_String_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The attribute name</param>
<summary>Deletes a user-defined attribute.</summary>
<remarks>
<para>Deletes a user-defined attribute.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/UserDefinedFileAttributeView#delete(java.lang.String)" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.UserDefinedFileAttributeView.delete(java.lang.String)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="List">
<MemberSignature Language="C#" Value="public System.Collections.Generic.IList<string>? List ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IList`1<string> List() cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView.List" />
<MemberSignature Language="F#" Value="abstract member List : unit -> System.Collections.Generic.IList<string>" Usage="iUserDefinedFileAttributeView.List " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("list", "()Ljava/util/List;", "GetListHandler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("list", "()Ljava/util/List;", "GetListHandler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IList<System.String></ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a list containing the names of the user-defined attributes.</summary>
<returns>An unmodifiable list containing the names of the file's
user-defined</returns>
<remarks>
<para>Returns a list containing the names of the user-defined attributes.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/UserDefinedFileAttributeView#list()" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.UserDefinedFileAttributeView.list()</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public string? Name ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string Name() cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView.Name" />
<MemberSignature Language="F#" Value="abstract member Name : unit -> string" Usage="iUserDefinedFileAttributeView.Name " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:Java.Nio.FileNio.Attributes.IAttributeView.Name</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("name", "()Ljava/lang/String;", "GetNameHandler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("name", "()Ljava/lang/String;", "GetNameHandler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the name of this attribute view.</summary>
<returns>To be added.</returns>
<remarks>
<para>Returns the name of this attribute view. Attribute views of this type
have the name <c>"user"</c>.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/UserDefinedFileAttributeView#name()" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.UserDefinedFileAttributeView.name()</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="Read">
<MemberSignature Language="C#" Value="public int Read (string? name, Java.Nio.ByteBuffer? dst);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 Read(string name, class Java.Nio.ByteBuffer dst) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView.Read(System.String,Java.Nio.ByteBuffer)" />
<MemberSignature Language="F#" Value="abstract member Read : string * Java.Nio.ByteBuffer -> int" Usage="iUserDefinedFileAttributeView.Read (name, dst)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("read", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)I", "GetRead_Ljava_lang_String_Ljava_nio_ByteBuffer_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("read", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)I", "GetRead_Ljava_lang_String_Ljava_nio_ByteBuffer_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="dst" Type="Java.Nio.ByteBuffer" />
</Parameters>
<Docs>
<param name="name">The attribute name</param>
<param name="dst">The destination buffer</param>
<summary>Read the value of a user-defined attribute into a buffer.</summary>
<returns>The number of bytes read, possibly zero</returns>
<remarks>
<para>Read the value of a user-defined attribute into a buffer.</para>
<para>This method reads the value of the attribute into the given buffer
as a sequence of bytes, failing if the number of bytes remaining in
the buffer is insufficient to read the complete attribute value. The
number of bytes transferred into the buffer is <c>n</c>, where <c>n</c>
is the size of the attribute value. The first byte in the sequence is at
index <c>p</c> and the last byte is at index <c>p + n - 1</c>, where
<c>p</c> is the buffer's position. Upon return the buffer's position
will be equal to <c>p + n</c>; its limit will not have changed.</para>
<para><b>Usage Example:</b>
Suppose we want to read a file's MIME type that is stored as a user-defined
attribute with the name "<c>user.mimetype</c>".</para>
<code lang="text/java">UserDefinedFileAttributeView view =
Files.getFileAttributeView(path, UserDefinedFileAttributeView.class);
String name = "user.mimetype";
ByteBuffer buf = ByteBuffer.allocate(view.size(name));
view.read(name, buf);
buf.flip();
String value = Charset.defaultCharset().decode(buf).toString();
</code>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/UserDefinedFileAttributeView#read(java.lang.String,%20java.nio.ByteBuffer)" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.UserDefinedFileAttributeView.read(java.lang.String, java.nio.ByteBuffer)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="Size">
<MemberSignature Language="C#" Value="public int Size (string? name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 Size(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView.Size(System.String)" />
<MemberSignature Language="F#" Value="abstract member Size : string -> int" Usage="iUserDefinedFileAttributeView.Size name" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("size", "(Ljava/lang/String;)I", "GetSize_Ljava_lang_String_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("size", "(Ljava/lang/String;)I", "GetSize_Ljava_lang_String_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The attribute name</param>
<summary>Returns the size of the value of a user-defined attribute.</summary>
<returns>The size of the attribute value, in bytes.</returns>
<remarks>
<para>Returns the size of the value of a user-defined attribute.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/UserDefinedFileAttributeView#size(java.lang.String)" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.UserDefinedFileAttributeView.size(java.lang.String)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="Write">
<MemberSignature Language="C#" Value="public int Write (string? name, Java.Nio.ByteBuffer? src);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 Write(string name, class Java.Nio.ByteBuffer src) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeView.Write(System.String,Java.Nio.ByteBuffer)" />
<MemberSignature Language="F#" Value="abstract member Write : string * Java.Nio.ByteBuffer -> int" Usage="iUserDefinedFileAttributeView.Write (name, src)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("write", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)I", "GetWrite_Ljava_lang_String_Ljava_nio_ByteBuffer_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("write", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)I", "GetWrite_Ljava_lang_String_Ljava_nio_ByteBuffer_Handler:Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="src" Type="Java.Nio.ByteBuffer" />
</Parameters>
<Docs>
<param name="name">The attribute name</param>
<param name="src">The buffer containing the attribute value</param>
<summary>Writes the value of a user-defined attribute from a buffer.</summary>
<returns>The number of bytes written, possibly zero</returns>
<remarks>
<para>Writes the value of a user-defined attribute from a buffer.</para>
<para>This method writes the value of the attribute from a given buffer as
a sequence of bytes. The size of the value to transfer is <c>r</c>,
where <c>r</c> is the number of bytes remaining in the buffer, that is
<c>src.remaining()</c>. The sequence of bytes is transferred from the
buffer starting at index <c>p</c>, where <c>p</c> is the buffer's
position. Upon return, the buffer's position will be equal to <c>p + n</c>, where <c>n</c> is the number of bytes transferred; its limit
will not have changed.</para>
<para>If an attribute of the given name already exists then its value is
replaced. If the attribute does not exist then it is created. If it
implementation specific if a test to check for the existence of the
attribute and the creation of attribute are atomic with respect to other
file system activities.</para>
<para>Where there is insufficient space to store the attribute, or the
attribute name or value exceed an implementation specific maximum size
then an <c>IOException</c> is thrown.</para>
<para><b>Usage Example:</b>
Suppose we want to write a file's MIME type as a user-defined attribute:</para>
<code lang="text/java">UserDefinedFileAttributeView view =
FIles.getFileAttributeView(path, UserDefinedFileAttributeView.class);
view.write("user.mimetype", Charset.defaultCharset().encode("text/html"));
</code>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/UserDefinedFileAttributeView#write(java.lang.String,%20java.nio.ByteBuffer)" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.UserDefinedFileAttributeView.write(java.lang.String, java.nio.ByteBuffer)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
</Members>
</Type>