mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8133459: replace <tt> tags (obsolete in html5) in java.nio docs
Reviewed-by: lancea
This commit is contained in:
parent
48b997d5b3
commit
6b4c935035
53 changed files with 543 additions and 534 deletions
|
@ -96,10 +96,10 @@ import jdk.internal.HotSpotIntrinsicCandidate;
|
|||
* capacity values:
|
||||
*
|
||||
* <blockquote>
|
||||
* <tt>0</tt> <tt><=</tt>
|
||||
* <i>mark</i> <tt><=</tt>
|
||||
* <i>position</i> <tt><=</tt>
|
||||
* <i>limit</i> <tt><=</tt>
|
||||
* {@code 0} {@code <=}
|
||||
* <i>mark</i> {@code <=}
|
||||
* <i>position</i> {@code <=}
|
||||
* <i>limit</i> {@code <=}
|
||||
* <i>capacity</i>
|
||||
* </blockquote>
|
||||
*
|
||||
|
@ -229,7 +229,7 @@ public abstract class Buffer {
|
|||
* The new buffer's capacity, in $type$s
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the <tt>capacity</tt> is a negative integer
|
||||
* If the {@code capacity} is a negative integer
|
||||
*/
|
||||
static IllegalArgumentException createCapacityException(int capacity) {
|
||||
assert capacity < 0 : "capacity expected to be negative";
|
||||
|
@ -266,7 +266,7 @@ public abstract class Buffer {
|
|||
* @return This buffer
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the preconditions on <tt>newPosition</tt> do not hold
|
||||
* If the preconditions on {@code newPosition} do not hold
|
||||
*/
|
||||
public Buffer position(int newPosition) {
|
||||
if (newPosition > limit | newPosition < 0)
|
||||
|
@ -319,7 +319,7 @@ public abstract class Buffer {
|
|||
* @return This buffer
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the preconditions on <tt>newLimit</tt> do not hold
|
||||
* If the preconditions on {@code newLimit} do not hold
|
||||
*/
|
||||
public Buffer limit(int newLimit) {
|
||||
if (newLimit > capacity | newLimit < 0)
|
||||
|
@ -468,7 +468,7 @@ public abstract class Buffer {
|
|||
* Tells whether there are any elements between the current position and
|
||||
* the limit.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, there is at least one element
|
||||
* @return {@code true} if, and only if, there is at least one element
|
||||
* remaining in this buffer
|
||||
*/
|
||||
public final boolean hasRemaining() {
|
||||
|
@ -478,7 +478,7 @@ public abstract class Buffer {
|
|||
/**
|
||||
* Tells whether or not this buffer is read-only.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this buffer is read-only
|
||||
* @return {@code true} if, and only if, this buffer is read-only
|
||||
*/
|
||||
public abstract boolean isReadOnly();
|
||||
|
||||
|
@ -486,11 +486,11 @@ public abstract class Buffer {
|
|||
* Tells whether or not this buffer is backed by an accessible
|
||||
* array.
|
||||
*
|
||||
* <p> If this method returns <tt>true</tt> then the {@link #array() array}
|
||||
* <p> If this method returns {@code true} then the {@link #array() array}
|
||||
* and {@link #arrayOffset() arrayOffset} methods may safely be invoked.
|
||||
* </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this buffer
|
||||
* @return {@code true} if, and only if, this buffer
|
||||
* is backed by an array and is not read-only
|
||||
*
|
||||
* @since 1.6
|
||||
|
@ -529,7 +529,7 @@ public abstract class Buffer {
|
|||
* element of the buffer <i>(optional operation)</i>.
|
||||
*
|
||||
* <p> If this buffer is backed by an array then buffer position <i>p</i>
|
||||
* corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
|
||||
* corresponds to array index <i>p</i> + {@code arrayOffset()}.
|
||||
*
|
||||
* <p> Invoke the {@link #hasArray hasArray} method before invoking this
|
||||
* method in order to ensure that this buffer has an accessible backing
|
||||
|
@ -552,7 +552,7 @@ public abstract class Buffer {
|
|||
* Tells whether or not this buffer is
|
||||
* <a href="ByteBuffer.html#direct"><i>direct</i></a>.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this buffer is direct
|
||||
* @return {@code true} if, and only if, this buffer is direct
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
|
|
|
@ -75,9 +75,9 @@ public final class ByteOrder {
|
|||
/**
|
||||
* Constructs a string describing this object.
|
||||
*
|
||||
* <p> This method returns the string <tt>"BIG_ENDIAN"</tt> for {@link
|
||||
* #BIG_ENDIAN} and <tt>"LITTLE_ENDIAN"</tt> for {@link #LITTLE_ENDIAN}.
|
||||
* </p>
|
||||
* <p> This method returns the string
|
||||
* {@code "BIG_ENDIAN"} for {@link #BIG_ENDIAN} and
|
||||
* {@code "LITTLE_ENDIAN"} for {@link #LITTLE_ENDIAN}.
|
||||
*
|
||||
* @return The specified string
|
||||
*/
|
||||
|
|
|
@ -116,10 +116,10 @@ public abstract class MappedByteBuffer
|
|||
* Tells whether or not this buffer's content is resident in physical
|
||||
* memory.
|
||||
*
|
||||
* <p> A return value of <tt>true</tt> implies that it is highly likely
|
||||
* <p> A return value of {@code true} implies that it is highly likely
|
||||
* that all of the data in this buffer is resident in physical memory and
|
||||
* may therefore be accessed without incurring any virtual-memory page
|
||||
* faults or I/O operations. A return value of <tt>false</tt> does not
|
||||
* faults or I/O operations. A return value of {@code false} does not
|
||||
* necessarily imply that the buffer's content is not resident in physical
|
||||
* memory.
|
||||
*
|
||||
|
@ -127,7 +127,7 @@ public abstract class MappedByteBuffer
|
|||
* underlying operating system may have paged out some of the buffer's data
|
||||
* by the time that an invocation of this method returns. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if it is likely that this buffer's content
|
||||
* @return {@code true} if it is likely that this buffer's content
|
||||
* is resident in physical memory
|
||||
*/
|
||||
public final boolean isLoaded() {
|
||||
|
|
|
@ -78,7 +78,7 @@ class XXX {
|
|||
* @return The $type$ value at the given index
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If <tt>index</tt> is negative
|
||||
* If {@code index} is negative
|
||||
* or not smaller than the buffer's limit,
|
||||
* minus $nbytesButOne$
|
||||
*/
|
||||
|
@ -100,7 +100,7 @@ class XXX {
|
|||
* @return This buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If <tt>index</tt> is negative
|
||||
* If {@code index} is negative
|
||||
* or not smaller than the buffer's limit,
|
||||
* minus $nbytesButOne$
|
||||
*
|
||||
|
|
|
@ -133,7 +133,7 @@ import java.util.stream.$Streamtype$Stream;
|
|||
* <h2> Access to binary data </h2>
|
||||
*
|
||||
* <p> This class defines methods for reading and writing values of all other
|
||||
* primitive types, except <tt>boolean</tt>. Primitive values are translated
|
||||
* primitive types, except {@code boolean}. Primitive values are translated
|
||||
* to (or from) sequences of bytes according to the buffer's current byte
|
||||
* order, which may be retrieved and modified via the {@link #order order}
|
||||
* methods. Specific byte orders are represented by instances of the {@link
|
||||
|
@ -151,8 +151,8 @@ import java.util.stream.$Streamtype$Stream;
|
|||
* void {@link #putFloat(float) putFloat(float f)}
|
||||
* void {@link #putFloat(int,float) putFloat(int index, float f)}</pre></blockquote>
|
||||
*
|
||||
* <p> Corresponding methods are defined for the types <tt>char</tt>,
|
||||
* <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and <tt>double</tt>. The index
|
||||
* <p> Corresponding methods are defined for the types {@code char,
|
||||
* short, int, long}, and {@code double}. The index
|
||||
* parameters of the absolute <i>get</i> and <i>put</i> methods are in terms of
|
||||
* bytes rather than of the type being read or written.
|
||||
*
|
||||
|
@ -167,8 +167,7 @@ import java.util.stream.$Streamtype$Stream;
|
|||
* #asFloatBuffer() asFloatBuffer} method, for example, creates an instance of
|
||||
* the {@link FloatBuffer} class that is backed by the byte buffer upon which
|
||||
* the method is invoked. Corresponding view-creation methods are defined for
|
||||
* the types <tt>char</tt>, <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and
|
||||
* <tt>double</tt>.
|
||||
* the types {@code char, short, int, long}, and {@code double}.
|
||||
*
|
||||
* <p> View buffers have three important advantages over the families of
|
||||
* type-specific <i>get</i> and <i>put</i> methods described above:
|
||||
|
@ -196,7 +195,7 @@ import java.util.stream.$Streamtype$Stream;
|
|||
*
|
||||
* <p> Like a byte buffer, $a$ $type$ buffer is either <a
|
||||
* href="ByteBuffer.html#direct"><i>direct</i> or <i>non-direct</i></a>. A
|
||||
* $type$ buffer created via the <tt>wrap</tt> methods of this class will
|
||||
* $type$ buffer created via the {@code wrap} methods of this class will
|
||||
* be non-direct. $A$ $type$ buffer created as a view of a byte buffer will
|
||||
* be direct if, and only if, the byte buffer itself is direct. Whether or not
|
||||
* $a$ $type$ buffer is direct may be determined by invoking the {@link
|
||||
|
@ -208,7 +207,7 @@ import java.util.stream.$Streamtype$Stream;
|
|||
*
|
||||
* <p> This class implements the {@link CharSequence} interface so that
|
||||
* character buffers may be used wherever character sequences are accepted, for
|
||||
* example in the regular-expression package <tt>{@link java.util.regex}</tt>.
|
||||
* example in the regular-expression package {@link java.util.regex}.
|
||||
* </p>
|
||||
*
|
||||
#end[char]
|
||||
|
@ -306,7 +305,7 @@ public abstract class $Type$Buffer
|
|||
* @return The new $type$ buffer
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the <tt>capacity</tt> is a negative integer
|
||||
* If the {@code capacity} is a negative integer
|
||||
*/
|
||||
public static $Type$Buffer allocateDirect(int capacity) {
|
||||
return new Direct$Type$Buffer(capacity);
|
||||
|
@ -335,7 +334,7 @@ public abstract class $Type$Buffer
|
|||
* @return The new $type$ buffer
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the <tt>capacity</tt> is a negative integer
|
||||
* If the {@code capacity} is a negative integer
|
||||
*/
|
||||
public static $Type$Buffer allocate(int capacity) {
|
||||
if (capacity < 0)
|
||||
|
@ -349,8 +348,8 @@ public abstract class $Type$Buffer
|
|||
* <p> The new buffer will be backed by the given $type$ array;
|
||||
* that is, modifications to the buffer will cause the array to be modified
|
||||
* and vice versa. The new buffer's capacity will be
|
||||
* <tt>array.length</tt>, its position will be <tt>offset</tt>, its limit
|
||||
* will be <tt>offset + length</tt>, its mark will be undefined, and its
|
||||
* {@code array.length}, its position will be {@code offset}, its limit
|
||||
* will be {@code offset + length}, its mark will be undefined, and its
|
||||
* byte order will be
|
||||
#if[byte]
|
||||
* {@link ByteOrder#BIG_ENDIAN BIG_ENDIAN}.
|
||||
|
@ -366,19 +365,19 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* @param offset
|
||||
* The offset of the subarray to be used; must be non-negative and
|
||||
* no larger than <tt>array.length</tt>. The new buffer's position
|
||||
* no larger than {@code array.length}. The new buffer's position
|
||||
* will be set to this value.
|
||||
*
|
||||
* @param length
|
||||
* The length of the subarray to be used;
|
||||
* must be non-negative and no larger than
|
||||
* <tt>array.length - offset</tt>.
|
||||
* The new buffer's limit will be set to <tt>offset + length</tt>.
|
||||
* {@code array.length - offset}.
|
||||
* The new buffer's limit will be set to {@code offset + length}.
|
||||
*
|
||||
* @return The new $type$ buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on the <tt>offset</tt> and <tt>length</tt>
|
||||
* If the preconditions on the {@code offset} and {@code length}
|
||||
* parameters do not hold
|
||||
*/
|
||||
public static $Type$Buffer wrap($type$[] array,
|
||||
|
@ -397,7 +396,7 @@ public abstract class $Type$Buffer
|
|||
* <p> The new buffer will be backed by the given $type$ array;
|
||||
* that is, modifications to the buffer will cause the array to be modified
|
||||
* and vice versa. The new buffer's capacity and limit will be
|
||||
* <tt>array.length</tt>, its position will be zero, its mark will be
|
||||
* {@code array.length}, its position will be zero, its mark will be
|
||||
* undefined, and its byte order will be
|
||||
#if[byte]
|
||||
* {@link ByteOrder#BIG_ENDIAN BIG_ENDIAN}.
|
||||
|
@ -458,8 +457,8 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> The content of the new, read-only buffer will be the content of the
|
||||
* given character sequence. The buffer's capacity will be
|
||||
* <tt>csq.length()</tt>, its position will be <tt>start</tt>, its limit
|
||||
* will be <tt>end</tt>, and its mark will be undefined. </p>
|
||||
* {@code csq.length()}, its position will be {@code start}, its limit
|
||||
* will be {@code end}, and its mark will be undefined. </p>
|
||||
*
|
||||
* @param csq
|
||||
* The character sequence from which the new character buffer is to
|
||||
|
@ -467,19 +466,19 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* @param start
|
||||
* The index of the first character to be used;
|
||||
* must be non-negative and no larger than <tt>csq.length()</tt>.
|
||||
* must be non-negative and no larger than {@code csq.length()}.
|
||||
* The new buffer's position will be set to this value.
|
||||
*
|
||||
* @param end
|
||||
* The index of the character following the last character to be
|
||||
* used; must be no smaller than <tt>start</tt> and no larger
|
||||
* than <tt>csq.length()</tt>.
|
||||
* used; must be no smaller than {@code start} and no larger
|
||||
* than {@code csq.length()}.
|
||||
* The new buffer's limit will be set to this value.
|
||||
*
|
||||
* @return The new character buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on the <tt>start</tt> and <tt>end</tt>
|
||||
* If the preconditions on the {@code start} and {@code end}
|
||||
* parameters do not hold
|
||||
*/
|
||||
public static CharBuffer wrap(CharSequence csq, int start, int end) {
|
||||
|
@ -495,7 +494,7 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> The content of the new, read-only buffer will be the content of the
|
||||
* given character sequence. The new buffer's capacity and limit will be
|
||||
* <tt>csq.length()</tt>, its position will be zero, and its mark will be
|
||||
* {@code csq.length()}, its position will be zero, and its mark will be
|
||||
* undefined. </p>
|
||||
*
|
||||
* @param csq
|
||||
|
@ -624,7 +623,7 @@ public abstract class $Type$Buffer
|
|||
* @return The $type$ at the given index
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If <tt>index</tt> is negative
|
||||
* If {@code index} is negative
|
||||
* or not smaller than the buffer's limit
|
||||
*/
|
||||
public abstract $type$ get(int index);
|
||||
|
@ -657,7 +656,7 @@ public abstract class $Type$Buffer
|
|||
* @return This buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If <tt>index</tt> is negative
|
||||
* If {@code index} is negative
|
||||
* or not smaller than the buffer's limit
|
||||
*
|
||||
* @throws ReadOnlyBufferException
|
||||
|
@ -674,17 +673,17 @@ public abstract class $Type$Buffer
|
|||
* <p> This method transfers $type$s from this buffer into the given
|
||||
* destination array. If there are fewer $type$s remaining in the
|
||||
* buffer than are required to satisfy the request, that is, if
|
||||
* <tt>length</tt> <tt>></tt> <tt>remaining()</tt>, then no
|
||||
* {@code length} {@code >} {@code remaining()}, then no
|
||||
* $type$s are transferred and a {@link BufferUnderflowException} is
|
||||
* thrown.
|
||||
*
|
||||
* <p> Otherwise, this method copies <tt>length</tt> $type$s from this
|
||||
* <p> Otherwise, this method copies {@code length} $type$s from this
|
||||
* buffer into the given array, starting at the current position of this
|
||||
* buffer and at the given offset in the array. The position of this
|
||||
* buffer is then incremented by <tt>length</tt>.
|
||||
* buffer is then incremented by {@code length}.
|
||||
*
|
||||
* <p> In other words, an invocation of this method of the form
|
||||
* <tt>src.get(dst, off, len)</tt> has exactly the same effect as
|
||||
* <code>src.get(dst, off, len)</code> has exactly the same effect as
|
||||
* the loop
|
||||
*
|
||||
* <pre>{@code
|
||||
|
@ -701,21 +700,21 @@ public abstract class $Type$Buffer
|
|||
* @param offset
|
||||
* The offset within the array of the first $type$ to be
|
||||
* written; must be non-negative and no larger than
|
||||
* <tt>dst.length</tt>
|
||||
* {@code dst.length}
|
||||
*
|
||||
* @param length
|
||||
* The maximum number of $type$s to be written to the given
|
||||
* array; must be non-negative and no larger than
|
||||
* <tt>dst.length - offset</tt>
|
||||
* {@code dst.length - offset}
|
||||
*
|
||||
* @return This buffer
|
||||
*
|
||||
* @throws BufferUnderflowException
|
||||
* If there are fewer than <tt>length</tt> $type$s
|
||||
* If there are fewer than {@code length} $type$s
|
||||
* remaining in this buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on the <tt>offset</tt> and <tt>length</tt>
|
||||
* If the preconditions on the {@code offset} and {@code length}
|
||||
* parameters do not hold
|
||||
*/
|
||||
public $Type$Buffer get($type$[] dst, int offset, int length) {
|
||||
|
@ -733,7 +732,7 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> This method transfers $type$s from this buffer into the given
|
||||
* destination array. An invocation of this method of the form
|
||||
* <tt>src.get(a)</tt> behaves in exactly the same way as the invocation
|
||||
* {@code src.get(a)} behaves in exactly the same way as the invocation
|
||||
*
|
||||
* <pre>
|
||||
* src.get(a, 0, a.length) </pre>
|
||||
|
@ -744,7 +743,7 @@ public abstract class $Type$Buffer
|
|||
* @return This buffer
|
||||
*
|
||||
* @throws BufferUnderflowException
|
||||
* If there are fewer than <tt>length</tt> $type$s
|
||||
* If there are fewer than {@code length} $type$s
|
||||
* remaining in this buffer
|
||||
*/
|
||||
public $Type$Buffer get($type$[] dst) {
|
||||
|
@ -760,17 +759,17 @@ public abstract class $Type$Buffer
|
|||
* <p> This method transfers the $type$s remaining in the given source
|
||||
* buffer into this buffer. If there are more $type$s remaining in the
|
||||
* source buffer than in this buffer, that is, if
|
||||
* <tt>src.remaining()</tt> <tt>></tt> <tt>remaining()</tt>,
|
||||
* {@code src.remaining()} {@code >} {@code remaining()},
|
||||
* then no $type$s are transferred and a {@link
|
||||
* BufferOverflowException} is thrown.
|
||||
*
|
||||
* <p> Otherwise, this method copies
|
||||
* <i>n</i> = <tt>src.remaining()</tt> $type$s from the given
|
||||
* <i>n</i> = {@code src.remaining()} $type$s from the given
|
||||
* buffer into this buffer, starting at each buffer's current position.
|
||||
* The positions of both buffers are then incremented by <i>n</i>.
|
||||
*
|
||||
* <p> In other words, an invocation of this method of the form
|
||||
* <tt>dst.put(src)</tt> has exactly the same effect as the loop
|
||||
* {@code dst.put(src)} has exactly the same effect as the loop
|
||||
*
|
||||
* <pre>
|
||||
* while (src.hasRemaining())
|
||||
|
@ -814,17 +813,17 @@ public abstract class $Type$Buffer
|
|||
* <p> This method transfers $type$s into this buffer from the given
|
||||
* source array. If there are more $type$s to be copied from the array
|
||||
* than remain in this buffer, that is, if
|
||||
* <tt>length</tt> <tt>></tt> <tt>remaining()</tt>, then no
|
||||
* {@code length} {@code >} {@code remaining()}, then no
|
||||
* $type$s are transferred and a {@link BufferOverflowException} is
|
||||
* thrown.
|
||||
*
|
||||
* <p> Otherwise, this method copies <tt>length</tt> $type$s from the
|
||||
* <p> Otherwise, this method copies {@code length} $type$s from the
|
||||
* given array into this buffer, starting at the given offset in the array
|
||||
* and at the current position of this buffer. The position of this buffer
|
||||
* is then incremented by <tt>length</tt>.
|
||||
* is then incremented by {@code length}.
|
||||
*
|
||||
* <p> In other words, an invocation of this method of the form
|
||||
* <tt>dst.put(src, off, len)</tt> has exactly the same effect as
|
||||
* <code>dst.put(src, off, len)</code> has exactly the same effect as
|
||||
* the loop
|
||||
*
|
||||
* <pre>{@code
|
||||
|
@ -840,12 +839,12 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* @param offset
|
||||
* The offset within the array of the first $type$ to be read;
|
||||
* must be non-negative and no larger than <tt>array.length</tt>
|
||||
* must be non-negative and no larger than {@code array.length}
|
||||
*
|
||||
* @param length
|
||||
* The number of $type$s to be read from the given array;
|
||||
* must be non-negative and no larger than
|
||||
* <tt>array.length - offset</tt>
|
||||
* {@code array.length - offset}
|
||||
*
|
||||
* @return This buffer
|
||||
*
|
||||
|
@ -853,7 +852,7 @@ public abstract class $Type$Buffer
|
|||
* If there is insufficient space in this buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on the <tt>offset</tt> and <tt>length</tt>
|
||||
* If the preconditions on the {@code offset} and {@code length}
|
||||
* parameters do not hold
|
||||
*
|
||||
* @throws ReadOnlyBufferException
|
||||
|
@ -874,7 +873,7 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> This method transfers the entire content of the given source
|
||||
* $type$ array into this buffer. An invocation of this method of the
|
||||
* form <tt>dst.put(a)</tt> behaves in exactly the same way as the
|
||||
* form {@code dst.put(a)} behaves in exactly the same way as the
|
||||
* invocation
|
||||
*
|
||||
* <pre>
|
||||
|
@ -903,18 +902,18 @@ public abstract class $Type$Buffer
|
|||
* <p> This method transfers $type$s from the given string into this
|
||||
* buffer. If there are more $type$s to be copied from the string than
|
||||
* remain in this buffer, that is, if
|
||||
* <tt>end - start</tt> <tt>></tt> <tt>remaining()</tt>,
|
||||
* <code>end - start</code> {@code >} {@code remaining()},
|
||||
* then no $type$s are transferred and a {@link
|
||||
* BufferOverflowException} is thrown.
|
||||
*
|
||||
* <p> Otherwise, this method copies
|
||||
* <i>n</i> = <tt>end</tt> - <tt>start</tt> $type$s
|
||||
* <i>n</i> = {@code end} - {@code start} $type$s
|
||||
* from the given string into this buffer, starting at the given
|
||||
* <tt>start</tt> index and at the current position of this buffer. The
|
||||
* {@code start} index and at the current position of this buffer. The
|
||||
* position of this buffer is then incremented by <i>n</i>.
|
||||
*
|
||||
* <p> In other words, an invocation of this method of the form
|
||||
* <tt>dst.put(src, start, end)</tt> has exactly the same effect
|
||||
* <code>dst.put(src, start, end)</code> has exactly the same effect
|
||||
* as the loop
|
||||
*
|
||||
* <pre>{@code
|
||||
|
@ -931,12 +930,12 @@ public abstract class $Type$Buffer
|
|||
* @param start
|
||||
* The offset within the string of the first $type$ to be read;
|
||||
* must be non-negative and no larger than
|
||||
* <tt>string.length()</tt>
|
||||
* {@code string.length()}
|
||||
*
|
||||
* @param end
|
||||
* The offset within the string of the last $type$ to be read,
|
||||
* plus one; must be non-negative and no larger than
|
||||
* <tt>string.length()</tt>
|
||||
* {@code string.length()}
|
||||
*
|
||||
* @return This buffer
|
||||
*
|
||||
|
@ -944,7 +943,7 @@ public abstract class $Type$Buffer
|
|||
* If there is insufficient space in this buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on the <tt>start</tt> and <tt>end</tt>
|
||||
* If the preconditions on the {@code start} and {@code end}
|
||||
* parameters do not hold
|
||||
*
|
||||
* @throws ReadOnlyBufferException
|
||||
|
@ -966,7 +965,7 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> This method transfers the entire content of the given source string
|
||||
* into this buffer. An invocation of this method of the form
|
||||
* <tt>dst.put(s)</tt> behaves in exactly the same way as the invocation
|
||||
* {@code dst.put(s)} behaves in exactly the same way as the invocation
|
||||
*
|
||||
* <pre>
|
||||
* dst.put(s, 0, s.length()) </pre>
|
||||
|
@ -995,11 +994,11 @@ public abstract class $Type$Buffer
|
|||
* Tells whether or not this buffer is backed by an accessible $type$
|
||||
* array.
|
||||
*
|
||||
* <p> If this method returns <tt>true</tt> then the {@link #array() array}
|
||||
* <p> If this method returns {@code true} then the {@link #array() array}
|
||||
* and {@link #arrayOffset() arrayOffset} methods may safely be invoked.
|
||||
* </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this buffer
|
||||
* @return {@code true} if, and only if, this buffer
|
||||
* is backed by an array and is not read-only
|
||||
*/
|
||||
public final boolean hasArray() {
|
||||
|
@ -1038,7 +1037,7 @@ public abstract class $Type$Buffer
|
|||
* element of the buffer <i>(optional operation)</i>.
|
||||
*
|
||||
* <p> If this buffer is backed by an array then buffer position <i>p</i>
|
||||
* corresponds to array index <i>p</i> + <tt>arrayOffset()</tt>.
|
||||
* corresponds to array index <i>p</i> + {@code arrayOffset()}.
|
||||
*
|
||||
* <p> Invoke the {@link #hasArray hasArray} method before invoking this
|
||||
* method in order to ensure that this buffer has an accessible backing
|
||||
|
@ -1166,11 +1165,11 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> The $type$s between the buffer's current position and its limit,
|
||||
* if any, are copied to the beginning of the buffer. That is, the
|
||||
* $type$ at index <i>p</i> = <tt>position()</tt> is copied
|
||||
* $type$ at index <i>p</i> = {@code position()} is copied
|
||||
* to index zero, the $type$ at index <i>p</i> + 1 is copied
|
||||
* to index one, and so forth until the $type$ at index
|
||||
* <tt>limit()</tt> - 1 is copied to index
|
||||
* <i>n</i> = <tt>limit()</tt> - <tt>1</tt> - <i>p</i>.
|
||||
* {@code limit()} - 1 is copied to index
|
||||
* <i>n</i> = {@code limit()} - {@code 1} - <i>p</i>.
|
||||
* The buffer's position is then set to <i>n+1</i> and its limit is set to
|
||||
* its capacity. The mark, if defined, is discarded.
|
||||
*
|
||||
|
@ -1183,7 +1182,7 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> Invoke this method after writing data from a buffer in case the
|
||||
* write was incomplete. The following loop, for example, copies bytes
|
||||
* from one channel to another via the buffer <tt>buf</tt>:
|
||||
* from one channel to another via the buffer {@code buf}:
|
||||
*
|
||||
* <blockquote><pre>{@code
|
||||
* buf.clear(); // Prepare buffer for use
|
||||
|
@ -1206,7 +1205,7 @@ public abstract class $Type$Buffer
|
|||
/**
|
||||
* Tells whether or not this $type$ buffer is direct.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this buffer is direct
|
||||
* @return {@code true} if, and only if, this buffer is direct
|
||||
*/
|
||||
public abstract boolean isDirect();
|
||||
|
||||
|
@ -1239,8 +1238,8 @@ public abstract class $Type$Buffer
|
|||
* Returns the current hash code of this buffer.
|
||||
*
|
||||
* <p> The hash code of a $type$ buffer depends only upon its remaining
|
||||
* elements; that is, upon the elements from <tt>position()</tt> up to, and
|
||||
* including, the element at <tt>limit()</tt> - <tt>1</tt>.
|
||||
* elements; that is, upon the elements from {@code position()} up to, and
|
||||
* including, the element at {@code limit()} - {@code 1}.
|
||||
*
|
||||
* <p> Because buffer hash codes are content-dependent, it is inadvisable
|
||||
* to use buffers as keys in hash maps or similar data structures unless it
|
||||
|
@ -1289,7 +1288,7 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* @param ob The object to which this buffer is to be compared
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this buffer is equal to the
|
||||
* @return {@code true} if, and only if, this buffer is equal to the
|
||||
* given object
|
||||
*/
|
||||
public boolean equals(Object ob) {
|
||||
|
@ -1368,7 +1367,7 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* <p> The first character of the resulting string will be the character at
|
||||
* this buffer's position, while the last character will be the character
|
||||
* at index <tt>limit()</tt> - 1. Invoking this method does not
|
||||
* at index {@code limit()} - 1. Invoking this method does not
|
||||
* change the buffer's position. </p>
|
||||
*
|
||||
* @return The specified string
|
||||
|
@ -1388,7 +1387,7 @@ public abstract class $Type$Buffer
|
|||
* <p> When viewed as a character sequence, the length of a character
|
||||
* buffer is simply the number of characters between the position
|
||||
* (inclusive) and the limit (exclusive); that is, it is equivalent to
|
||||
* <tt>remaining()</tt>. </p>
|
||||
* {@code remaining()}. </p>
|
||||
*
|
||||
* @return The length of this character buffer
|
||||
*/
|
||||
|
@ -1402,13 +1401,13 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* @param index
|
||||
* The index of the character to be read, relative to the position;
|
||||
* must be non-negative and smaller than <tt>remaining()</tt>
|
||||
* must be non-negative and smaller than {@code remaining()}
|
||||
*
|
||||
* @return The character at index
|
||||
* <tt>position() + index</tt>
|
||||
* <code>position() + index</code>
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on <tt>index</tt> do not hold
|
||||
* If the preconditions on {@code index} do not hold
|
||||
*/
|
||||
public final char charAt(int index) {
|
||||
return get(position() + checkIndex(index, 1));
|
||||
|
@ -1422,26 +1421,26 @@ public abstract class $Type$Buffer
|
|||
* content of this buffer is mutable then modifications to one buffer will
|
||||
* cause the other to be modified. The new buffer's capacity will be that
|
||||
* of this buffer, its position will be
|
||||
* <tt>position()</tt> + <tt>start</tt>, and its limit will be
|
||||
* <tt>position()</tt> + <tt>end</tt>. The new buffer will be
|
||||
* {@code position()} + {@code start}, and its limit will be
|
||||
* {@code position()} + {@code end}. The new buffer will be
|
||||
* direct if, and only if, this buffer is direct, and it will be read-only
|
||||
* if, and only if, this buffer is read-only. </p>
|
||||
*
|
||||
* @param start
|
||||
* The index, relative to the current position, of the first
|
||||
* character in the subsequence; must be non-negative and no larger
|
||||
* than <tt>remaining()</tt>
|
||||
* than {@code remaining()}
|
||||
*
|
||||
* @param end
|
||||
* The index, relative to the current position, of the character
|
||||
* following the last character in the subsequence; must be no
|
||||
* smaller than <tt>start</tt> and no larger than
|
||||
* <tt>remaining()</tt>
|
||||
* smaller than {@code start} and no larger than
|
||||
* {@code remaining()}
|
||||
*
|
||||
* @return The new character buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on <tt>start</tt> and <tt>end</tt>
|
||||
* If the preconditions on {@code start} and {@code end}
|
||||
* do not hold
|
||||
*/
|
||||
public abstract CharBuffer subSequence(int start, int end);
|
||||
|
@ -1453,21 +1452,21 @@ public abstract class $Type$Buffer
|
|||
* Appends the specified character sequence to this
|
||||
* buffer <i>(optional operation)</i>.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>dst.append(csq)</tt>
|
||||
* <p> An invocation of this method of the form {@code dst.append(csq)}
|
||||
* behaves in exactly the same way as the invocation
|
||||
*
|
||||
* <pre>
|
||||
* dst.put(csq.toString()) </pre>
|
||||
*
|
||||
* <p> Depending on the specification of <tt>toString</tt> for the
|
||||
* character sequence <tt>csq</tt>, the entire sequence may not be
|
||||
* <p> Depending on the specification of {@code toString} for the
|
||||
* character sequence {@code csq}, the entire sequence may not be
|
||||
* appended. For instance, invoking the {@link $Type$Buffer#toString()
|
||||
* toString} method of a character buffer will return a subsequence whose
|
||||
* content depends upon the buffer's position and limit.
|
||||
*
|
||||
* @param csq
|
||||
* The character sequence to append. If <tt>csq</tt> is
|
||||
* <tt>null</tt>, then the four characters <tt>"null"</tt> are
|
||||
* The character sequence to append. If {@code csq} is
|
||||
* {@code null}, then the four characters {@code "null"} are
|
||||
* appended to this character buffer.
|
||||
*
|
||||
* @return This buffer
|
||||
|
@ -1491,8 +1490,8 @@ public abstract class $Type$Buffer
|
|||
* Appends a subsequence of the specified character sequence to this
|
||||
* buffer <i>(optional operation)</i>.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>dst.append(csq, start,
|
||||
* end)</tt> when <tt>csq</tt> is not <tt>null</tt>, behaves in exactly the
|
||||
* <p> An invocation of this method of the form {@code dst.append(csq, start,
|
||||
* end)} when {@code csq} is not {@code null}, behaves in exactly the
|
||||
* same way as the invocation
|
||||
*
|
||||
* <pre>
|
||||
|
@ -1500,9 +1499,9 @@ public abstract class $Type$Buffer
|
|||
*
|
||||
* @param csq
|
||||
* The character sequence from which a subsequence will be
|
||||
* appended. If <tt>csq</tt> is <tt>null</tt>, then characters
|
||||
* will be appended as if <tt>csq</tt> contained the four
|
||||
* characters <tt>"null"</tt>.
|
||||
* appended. If {@code csq} is {@code null}, then characters
|
||||
* will be appended as if {@code csq} contained the four
|
||||
* characters {@code "null"}.
|
||||
*
|
||||
* @return This buffer
|
||||
*
|
||||
|
@ -1510,9 +1509,9 @@ public abstract class $Type$Buffer
|
|||
* If there is insufficient space in this buffer
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If <tt>start</tt> or <tt>end</tt> are negative, <tt>start</tt>
|
||||
* is greater than <tt>end</tt>, or <tt>end</tt> is greater than
|
||||
* <tt>csq.length()</tt>
|
||||
* If {@code start} or {@code end} are negative, {@code start}
|
||||
* is greater than {@code end}, or {@code end} is greater than
|
||||
* {@code csq.length()}
|
||||
*
|
||||
* @throws ReadOnlyBufferException
|
||||
* If this buffer is read-only
|
||||
|
@ -1528,7 +1527,7 @@ public abstract class $Type$Buffer
|
|||
* Appends the specified $type$ to this
|
||||
* buffer <i>(optional operation)</i>.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>dst.append($x$)</tt>
|
||||
* <p> An invocation of this method of the form {@code dst.append($x$)}
|
||||
* behaves in exactly the same way as the invocation
|
||||
*
|
||||
* <pre>
|
||||
|
@ -1562,7 +1561,7 @@ public abstract class $Type$Buffer
|
|||
* Retrieves this buffer's byte order.
|
||||
*
|
||||
* <p> The byte order of $a$ $type$ buffer created by allocation or by
|
||||
* wrapping an existing <tt>$type$</tt> array is the {@link
|
||||
* wrapping an existing {@code $type$} array is the {@link
|
||||
* ByteOrder#nativeOrder native order} of the underlying
|
||||
* hardware. The byte order of $a$ $type$ buffer created as a <a
|
||||
* href="ByteBuffer.html#views">view</a> of a byte buffer is that of the
|
||||
|
|
|
@ -70,13 +70,13 @@ public interface AsynchronousByteChannel
|
|||
* {@code 0} without initiating an I/O operation.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is read, where
|
||||
* <tt>0</tt> <tt><</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* {@code 0} {@code <} <i>n</i> {@code <=} <i>r</i>.
|
||||
* This byte sequence will be transferred into the buffer so that the first
|
||||
* byte in the sequence is at index <i>p</i> and the last byte is at index
|
||||
* <i>p</i> <tt>+</tt> <i>n</i> <tt>-</tt> <tt>1</tt>,
|
||||
* <i>p</i> {@code +} <i>n</i> {@code -} {@code 1},
|
||||
* where <i>p</i> is the buffer's position at the moment the read is
|
||||
* performed. Upon completion the buffer's position will be equal to
|
||||
* <i>p</i> <tt>+</tt> <i>n</i>; its limit will not have changed.
|
||||
* <i>p</i> {@code +} <i>n</i>; its limit will not have changed.
|
||||
*
|
||||
* <p> Buffers are not safe for use by multiple concurrent threads so care
|
||||
* should be taken to not access the buffer until the operation has
|
||||
|
@ -151,13 +151,13 @@ public interface AsynchronousByteChannel
|
|||
* {@code 0} without initiating an I/O operation.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is written, where
|
||||
* <tt>0</tt> <tt><</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* {@code 0} {@code <} <i>n</i> {@code <=} <i>r</i>.
|
||||
* This byte sequence will be transferred from the buffer starting at index
|
||||
* <i>p</i>, where <i>p</i> is the buffer's position at the moment the
|
||||
* write is performed; the index of the last byte written will be
|
||||
* <i>p</i> <tt>+</tt> <i>n</i> <tt>-</tt> <tt>1</tt>.
|
||||
* <i>p</i> {@code +} <i>n</i> {@code -} {@code 1}.
|
||||
* Upon completion the buffer's position will be equal to
|
||||
* <i>p</i> <tt>+</tt> <i>n</i>; its limit will not have changed.
|
||||
* <i>p</i> {@code +} <i>n</i>; its limit will not have changed.
|
||||
*
|
||||
* <p> Buffers are not safe for use by multiple concurrent threads so care
|
||||
* should be taken to not access the buffer until the operation has
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.io.IOException;
|
|||
* by invoking the {@link #bind(SocketAddress,int) bind} method. Once bound,
|
||||
* the {@link #accept(Object,CompletionHandler) accept} method
|
||||
* is used to initiate the accepting of connections to the channel's socket.
|
||||
* An attempt to invoke the <tt>accept</tt> method on an unbound channel will
|
||||
* An attempt to invoke the {@code accept} method on an unbound channel will
|
||||
* cause a {@link NotYetBoundException} to be thrown.
|
||||
*
|
||||
* <p> Channels of this type are safe for use by multiple concurrent threads
|
||||
|
@ -122,13 +122,13 @@ public abstract class AsynchronousServerSocketChannel
|
|||
* java.nio.channels.spi.AsynchronousChannelProvider#openAsynchronousServerSocketChannel
|
||||
* openAsynchronousServerSocketChannel} method on the {@link
|
||||
* java.nio.channels.spi.AsynchronousChannelProvider} object that created
|
||||
* the given group. If the group parameter is <tt>null</tt> then the
|
||||
* the given group. If the group parameter is {@code null} then the
|
||||
* resulting channel is created by the system-wide default provider, and
|
||||
* bound to the <em>default group</em>.
|
||||
*
|
||||
* @param group
|
||||
* The group to which the newly constructed channel should be bound,
|
||||
* or <tt>null</tt> for the default group
|
||||
* or {@code null} for the default group
|
||||
*
|
||||
* @return A new asynchronous server socket channel
|
||||
*
|
||||
|
@ -176,7 +176,7 @@ public abstract class AsynchronousServerSocketChannel
|
|||
* </pre></blockquote>
|
||||
*
|
||||
* @param local
|
||||
* The local address to bind the socket, or <tt>null</tt> to bind
|
||||
* The local address to bind the socket, or {@code null} to bind
|
||||
* to an automatically assigned socket address
|
||||
*
|
||||
* @return This channel
|
||||
|
|
|
@ -452,11 +452,11 @@ public abstract class AsynchronousSocketChannel
|
|||
* at the moment that the read is attempted.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is read, where
|
||||
* <tt>0</tt> <tt><</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* Up to the first <tt>dsts[offset].remaining()</tt> bytes of this sequence
|
||||
* are transferred into buffer <tt>dsts[offset]</tt>, up to the next
|
||||
* <tt>dsts[offset+1].remaining()</tt> bytes are transferred into buffer
|
||||
* <tt>dsts[offset+1]</tt>, and so forth, until the entire byte sequence
|
||||
* {@code 0} {@code <} <i>n</i> {@code <=} <i>r</i>.
|
||||
* Up to the first {@code dsts[offset].remaining()} bytes of this sequence
|
||||
* are transferred into buffer {@code dsts[offset]}, up to the next
|
||||
* {@code dsts[offset+1].remaining()} bytes are transferred into buffer
|
||||
* {@code dsts[offset+1]}, and so forth, until the entire byte sequence
|
||||
* is transferred into the given buffers. As many bytes as possible are
|
||||
* transferred into each buffer, hence the final position of each updated
|
||||
* buffer, except the last updated buffer, is guaranteed to be equal to
|
||||
|
@ -606,11 +606,11 @@ public abstract class AsynchronousSocketChannel
|
|||
* at the moment that the write is attempted.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is written, where
|
||||
* <tt>0</tt> <tt><</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* Up to the first <tt>srcs[offset].remaining()</tt> bytes of this sequence
|
||||
* are written from buffer <tt>srcs[offset]</tt>, up to the next
|
||||
* <tt>srcs[offset+1].remaining()</tt> bytes are written from buffer
|
||||
* <tt>srcs[offset+1]</tt>, and so forth, until the entire byte sequence is
|
||||
* {@code 0} {@code <} <i>n</i> {@code <=} <i>r</i>.
|
||||
* Up to the first {@code srcs[offset].remaining()} bytes of this sequence
|
||||
* are written from buffer {@code srcs[offset]}, up to the next
|
||||
* {@code srcs[offset+1].remaining()} bytes are written from buffer
|
||||
* {@code srcs[offset+1]}, and so forth, until the entire byte sequence is
|
||||
* written. As many bytes as possible are written from each buffer, hence
|
||||
* the final position of each updated buffer, except the last updated
|
||||
* buffer, is guaranteed to be equal to that buffer's limit. The underlying
|
||||
|
|
|
@ -58,7 +58,7 @@ public interface Channel extends Closeable {
|
|||
/**
|
||||
* Tells whether or not this channel is open.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this channel is open
|
||||
* @return {@code true} if, and only if, this channel is open
|
||||
*/
|
||||
public boolean isOpen();
|
||||
|
||||
|
|
|
@ -187,8 +187,8 @@ public abstract class DatagramChannel
|
|||
* operations.
|
||||
*
|
||||
* <p> Datagram channels support reading and writing, so this method
|
||||
* returns <tt>(</tt>{@link SelectionKey#OP_READ} <tt>|</tt> {@link
|
||||
* SelectionKey#OP_WRITE}<tt>)</tt>. </p>
|
||||
* returns {@code (}{@link SelectionKey#OP_READ} {@code |} {@link
|
||||
* SelectionKey#OP_WRITE}{@code )}.
|
||||
*
|
||||
* @return The valid-operation set
|
||||
*/
|
||||
|
@ -341,7 +341,7 @@ public abstract class DatagramChannel
|
|||
* copied into the given byte buffer and its source address is returned.
|
||||
* If this channel is in non-blocking mode and a datagram is not
|
||||
* immediately available then this method immediately returns
|
||||
* <tt>null</tt>.
|
||||
* {@code null}.
|
||||
*
|
||||
* <p> The datagram is transferred into the given byte buffer starting at
|
||||
* its current position, as if by a regular {@link
|
||||
|
@ -371,7 +371,7 @@ public abstract class DatagramChannel
|
|||
* The buffer into which the datagram is to be transferred
|
||||
*
|
||||
* @return The datagram's source address,
|
||||
* or <tt>null</tt> if this channel is in non-blocking mode
|
||||
* or {@code null} if this channel is in non-blocking mode
|
||||
* and no datagram was immediately available
|
||||
*
|
||||
* @throws ClosedChannelException
|
||||
|
|
|
@ -63,7 +63,7 @@ import java.util.Collections;
|
|||
*
|
||||
* <li><p> A region of a file may be {@link #map <i>mapped</i>}
|
||||
* directly into memory; for large files this is often much more efficient
|
||||
* than invoking the usual <tt>read</tt> or <tt>write</tt> methods.
|
||||
* than invoking the usual {@code read} or {@code write} methods.
|
||||
* </p></li>
|
||||
*
|
||||
* <li><p> Updates made to a file may be {@link #force <i>forced
|
||||
|
@ -107,10 +107,10 @@ import java.util.Collections;
|
|||
* existing {@link java.io.FileInputStream#getChannel FileInputStream}, {@link
|
||||
* java.io.FileOutputStream#getChannel FileOutputStream}, or {@link
|
||||
* java.io.RandomAccessFile#getChannel RandomAccessFile} object by invoking
|
||||
* that object's <tt>getChannel</tt> method, which returns a file channel that
|
||||
* that object's {@code getChannel} method, which returns a file channel that
|
||||
* is connected to the same underlying file. Where the file channel is obtained
|
||||
* from an existing stream or random access file then the state of the file
|
||||
* channel is intimately connected to that of the object whose <tt>getChannel</tt>
|
||||
* channel is intimately connected to that of the object whose {@code getChannel}
|
||||
* method returned the channel. Changing the channel's position, whether
|
||||
* explicitly or by reading or writing bytes, will change the file position of
|
||||
* the originating object, and vice versa. Changing the file's length via the
|
||||
|
@ -128,14 +128,14 @@ import java.util.Collections;
|
|||
* writing. Finally, a channel obtained via the {@link
|
||||
* java.io.RandomAccessFile#getChannel getChannel} method of a {@link
|
||||
* java.io.RandomAccessFile} instance will be open for reading if the instance
|
||||
* was created with mode <tt>"r"</tt> and will be open for reading and writing
|
||||
* if the instance was created with mode <tt>"rw"</tt>.
|
||||
* was created with mode {@code "r"} and will be open for reading and writing
|
||||
* if the instance was created with mode {@code "rw"}.
|
||||
*
|
||||
* <a name="append-mode"></a><p> A file channel that is open for writing may be in
|
||||
* <i>append mode</i>, for example if it was obtained from a file-output stream
|
||||
* that was created by invoking the {@link
|
||||
* java.io.FileOutputStream#FileOutputStream(java.io.File,boolean)
|
||||
* FileOutputStream(File,boolean)} constructor and passing <tt>true</tt> for
|
||||
* FileOutputStream(File,boolean)} constructor and passing {@code true} for
|
||||
* the second parameter. In this mode each invocation of a relative write
|
||||
* operation first advances the position to the end of the file and then writes
|
||||
* the requested data. Whether the advancement of the position and the writing
|
||||
|
@ -516,10 +516,10 @@ public abstract class FileChannel
|
|||
* <p> If the file does not reside on a local device then no such guarantee
|
||||
* is made.
|
||||
*
|
||||
* <p> The <tt>metaData</tt> parameter can be used to limit the number of
|
||||
* <p> The {@code metaData} parameter can be used to limit the number of
|
||||
* I/O operations that this method is required to perform. Passing
|
||||
* <tt>false</tt> for this parameter indicates that only updates to the
|
||||
* file's content need be written to storage; passing <tt>true</tt>
|
||||
* {@code false} for this parameter indicates that only updates to the
|
||||
* file's content need be written to storage; passing {@code true}
|
||||
* indicates that updates to both the file's content and metadata must be
|
||||
* written, which generally requires at least one more I/O operation.
|
||||
* Whether this parameter actually has any effect is dependent upon the
|
||||
|
@ -540,7 +540,7 @@ public abstract class FileChannel
|
|||
* force changes made to the buffer's content to be written. </p>
|
||||
*
|
||||
* @param metaData
|
||||
* If <tt>true</tt> then this method is required to force changes
|
||||
* If {@code true} then this method is required to force changes
|
||||
* to both the file's content and metadata to be written to
|
||||
* storage; otherwise, it need only force content changes to be
|
||||
* written
|
||||
|
@ -557,14 +557,14 @@ public abstract class FileChannel
|
|||
* Transfers bytes from this channel's file to the given writable byte
|
||||
* channel.
|
||||
*
|
||||
* <p> An attempt is made to read up to <tt>count</tt> bytes starting at
|
||||
* the given <tt>position</tt> in this channel's file and write them to the
|
||||
* <p> An attempt is made to read up to {@code count} bytes starting at
|
||||
* the given {@code position} in this channel's file and write them to the
|
||||
* target channel. An invocation of this method may or may not transfer
|
||||
* all of the requested bytes; whether or not it does so depends upon the
|
||||
* natures and states of the channels. Fewer than the requested number of
|
||||
* bytes are transferred if this channel's file contains fewer than
|
||||
* <tt>count</tt> bytes starting at the given <tt>position</tt>, or if the
|
||||
* target channel is non-blocking and it has fewer than <tt>count</tt>
|
||||
* {@code count} bytes starting at the given {@code position}, or if the
|
||||
* target channel is non-blocking and it has fewer than {@code count}
|
||||
* bytes free in its output buffer.
|
||||
*
|
||||
* <p> This method does not modify this channel's position. If the given
|
||||
|
@ -624,14 +624,14 @@ public abstract class FileChannel
|
|||
* Transfers bytes into this channel's file from the given readable byte
|
||||
* channel.
|
||||
*
|
||||
* <p> An attempt is made to read up to <tt>count</tt> bytes from the
|
||||
* <p> An attempt is made to read up to {@code count} bytes from the
|
||||
* source channel and write them to this channel's file starting at the
|
||||
* given <tt>position</tt>. An invocation of this method may or may not
|
||||
* given {@code position}. An invocation of this method may or may not
|
||||
* transfer all of the requested bytes; whether or not it does so depends
|
||||
* upon the natures and states of the channels. Fewer than the requested
|
||||
* number of bytes will be transferred if the source channel has fewer than
|
||||
* <tt>count</tt> bytes remaining, or if the source channel is non-blocking
|
||||
* and has fewer than <tt>count</tt> bytes immediately available in its
|
||||
* {@code count} bytes remaining, or if the source channel is non-blocking
|
||||
* and has fewer than {@code count} bytes immediately available in its
|
||||
* input buffer.
|
||||
*
|
||||
* <p> This method does not modify this channel's position. If the given
|
||||
|
@ -704,7 +704,7 @@ public abstract class FileChannel
|
|||
* The file position at which the transfer is to begin;
|
||||
* must be non-negative
|
||||
*
|
||||
* @return The number of bytes read, possibly zero, or <tt>-1</tt> if the
|
||||
* @return The number of bytes read, possibly zero, or {@code -1} if the
|
||||
* given position is greater than or equal to the file's current
|
||||
* size
|
||||
*
|
||||
|
@ -855,7 +855,7 @@ public abstract class FileChannel
|
|||
*
|
||||
* <p> The {@link MappedByteBuffer <i>mapped byte buffer</i>}
|
||||
* returned by this method will have a position of zero and a limit and
|
||||
* capacity of <tt>size</tt>; its mark will be undefined. The buffer and
|
||||
* capacity of {@code size}; its mark will be undefined. The buffer and
|
||||
* the mapping that it represents will remain valid until the buffer itself
|
||||
* is garbage-collected.
|
||||
*
|
||||
|
@ -895,11 +895,11 @@ public abstract class FileChannel
|
|||
* @return The mapped byte buffer
|
||||
*
|
||||
* @throws NonReadableChannelException
|
||||
* If the <tt>mode</tt> is {@link MapMode#READ_ONLY READ_ONLY} but
|
||||
* If the {@code mode} is {@link MapMode#READ_ONLY READ_ONLY} but
|
||||
* this channel was not opened for reading
|
||||
*
|
||||
* @throws NonWritableChannelException
|
||||
* If the <tt>mode</tt> is {@link MapMode#READ_WRITE READ_WRITE} or
|
||||
* If the {@code mode} is {@link MapMode#READ_WRITE READ_WRITE} or
|
||||
* {@link MapMode#PRIVATE PRIVATE} but this channel was not opened
|
||||
* for both reading and writing
|
||||
*
|
||||
|
@ -936,7 +936,7 @@ public abstract class FileChannel
|
|||
* will be thrown immediately; the thread's interrupt status will not be
|
||||
* changed.
|
||||
*
|
||||
* <p> The region specified by the <tt>position</tt> and <tt>size</tt>
|
||||
* <p> The region specified by the {@code position} and {@code size}
|
||||
* parameters need not be contained within, or even overlap, the actual
|
||||
* underlying file. Lock regions are fixed in size; if a locked region
|
||||
* initially contains the end of the file and the file grows beyond the
|
||||
|
@ -963,12 +963,12 @@ public abstract class FileChannel
|
|||
*
|
||||
* @param size
|
||||
* The size of the locked region; must be non-negative, and the sum
|
||||
* <tt>position</tt> + <tt>size</tt> must be non-negative
|
||||
* {@code position} + {@code size} must be non-negative
|
||||
*
|
||||
* @param shared
|
||||
* <tt>true</tt> to request a shared lock, in which case this
|
||||
* {@code true} to request a shared lock, in which case this
|
||||
* channel must be open for reading (and possibly writing);
|
||||
* <tt>false</tt> to request an exclusive lock, in which case this
|
||||
* {@code false} to request an exclusive lock, in which case this
|
||||
* channel must be open for writing (and possibly reading)
|
||||
*
|
||||
* @return A lock object representing the newly-acquired lock
|
||||
|
@ -994,11 +994,11 @@ public abstract class FileChannel
|
|||
* region
|
||||
*
|
||||
* @throws NonReadableChannelException
|
||||
* If <tt>shared</tt> is <tt>true</tt> this channel was not
|
||||
* If {@code shared} is {@code true} this channel was not
|
||||
* opened for reading
|
||||
*
|
||||
* @throws NonWritableChannelException
|
||||
* If <tt>shared</tt> is <tt>false</tt> but this channel was not
|
||||
* If {@code shared} is {@code false} but this channel was not
|
||||
* opened for writing
|
||||
*
|
||||
* @throws IOException
|
||||
|
@ -1014,7 +1014,7 @@ public abstract class FileChannel
|
|||
/**
|
||||
* Acquires an exclusive lock on this channel's file.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>fc.lock()</tt> behaves
|
||||
* <p> An invocation of this method of the form {@code fc.lock()} behaves
|
||||
* in exactly the same way as the invocation
|
||||
*
|
||||
* <pre>
|
||||
|
@ -1060,10 +1060,10 @@ public abstract class FileChannel
|
|||
* immediately, either having acquired a lock on the requested region or
|
||||
* having failed to do so. If it fails to acquire a lock because an
|
||||
* overlapping lock is held by another program then it returns
|
||||
* <tt>null</tt>. If it fails to acquire a lock for any other reason then
|
||||
* {@code null}. If it fails to acquire a lock for any other reason then
|
||||
* an appropriate exception is thrown.
|
||||
*
|
||||
* <p> The region specified by the <tt>position</tt> and <tt>size</tt>
|
||||
* <p> The region specified by the {@code position} and {@code size}
|
||||
* parameters need not be contained within, or even overlap, the actual
|
||||
* underlying file. Lock regions are fixed in size; if a locked region
|
||||
* initially contains the end of the file and the file grows beyond the
|
||||
|
@ -1090,14 +1090,14 @@ public abstract class FileChannel
|
|||
*
|
||||
* @param size
|
||||
* The size of the locked region; must be non-negative, and the sum
|
||||
* <tt>position</tt> + <tt>size</tt> must be non-negative
|
||||
* {@code position} + {@code size} must be non-negative
|
||||
*
|
||||
* @param shared
|
||||
* <tt>true</tt> to request a shared lock,
|
||||
* <tt>false</tt> to request an exclusive lock
|
||||
* {@code true} to request a shared lock,
|
||||
* {@code false} to request an exclusive lock
|
||||
*
|
||||
* @return A lock object representing the newly-acquired lock,
|
||||
* or <tt>null</tt> if the lock could not be acquired
|
||||
* or {@code null} if the lock could not be acquired
|
||||
* because another program holds an overlapping lock
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
|
@ -1125,14 +1125,14 @@ public abstract class FileChannel
|
|||
/**
|
||||
* Attempts to acquire an exclusive lock on this channel's file.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>fc.tryLock()</tt>
|
||||
* <p> An invocation of this method of the form {@code fc.tryLock()}
|
||||
* behaves in exactly the same way as the invocation
|
||||
*
|
||||
* <pre>
|
||||
* fc.{@link #tryLock(long,long,boolean) tryLock}(0L, Long.MAX_VALUE, false) </pre>
|
||||
*
|
||||
* @return A lock object representing the newly-acquired lock,
|
||||
* or <tt>null</tt> if the lock could not be acquired
|
||||
* or {@code null} if the lock could not be acquired
|
||||
* because another program holds an overlapping lock
|
||||
*
|
||||
* @throws ClosedChannelException
|
||||
|
|
|
@ -136,11 +136,11 @@ public abstract class FileLock implements AutoCloseable {
|
|||
*
|
||||
* @param size
|
||||
* The size of the locked region; must be non-negative, and the sum
|
||||
* <tt>position</tt> + <tt>size</tt> must be non-negative
|
||||
* {@code position} + {@code size} must be non-negative
|
||||
*
|
||||
* @param shared
|
||||
* <tt>true</tt> if this lock is shared,
|
||||
* <tt>false</tt> if it is exclusive
|
||||
* {@code true} if this lock is shared,
|
||||
* {@code false} if it is exclusive
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the preconditions on the parameters do not hold
|
||||
|
@ -173,11 +173,11 @@ public abstract class FileLock implements AutoCloseable {
|
|||
*
|
||||
* @param size
|
||||
* The size of the locked region; must be non-negative, and the sum
|
||||
* <tt>position</tt> + <tt>size</tt> must be non-negative
|
||||
* {@code position} + {@code size} must be non-negative
|
||||
*
|
||||
* @param shared
|
||||
* <tt>true</tt> if this lock is shared,
|
||||
* <tt>false</tt> if it is exclusive
|
||||
* {@code true} if this lock is shared,
|
||||
* {@code false} if it is exclusive
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the preconditions on the parameters do not hold
|
||||
|
@ -254,8 +254,8 @@ public abstract class FileLock implements AutoCloseable {
|
|||
/**
|
||||
* Tells whether this lock is shared.
|
||||
*
|
||||
* @return <tt>true</tt> if lock is shared,
|
||||
* <tt>false</tt> if it is exclusive
|
||||
* @return {@code true} if lock is shared,
|
||||
* {@code false} if it is exclusive
|
||||
*/
|
||||
public final boolean isShared() {
|
||||
return shared;
|
||||
|
@ -269,7 +269,7 @@ public abstract class FileLock implements AutoCloseable {
|
|||
* @param size
|
||||
* The size of the lock range
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this lock and the given lock
|
||||
* @return {@code true} if, and only if, this lock and the given lock
|
||||
* range overlap by at least one byte
|
||||
*/
|
||||
public final boolean overlaps(long position, long size) {
|
||||
|
@ -286,7 +286,7 @@ public abstract class FileLock implements AutoCloseable {
|
|||
* <p> A lock object remains valid until it is released or the associated
|
||||
* file channel is closed, whichever comes first. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this lock is valid
|
||||
* @return {@code true} if, and only if, this lock is valid
|
||||
*/
|
||||
public abstract boolean isValid();
|
||||
|
||||
|
|
|
@ -66,11 +66,11 @@ public interface GatheringByteChannel
|
|||
* at the moment that this method is invoked.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is written, where
|
||||
* <tt>0</tt> <tt><=</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* Up to the first <tt>srcs[offset].remaining()</tt> bytes of this sequence
|
||||
* are written from buffer <tt>srcs[offset]</tt>, up to the next
|
||||
* <tt>srcs[offset+1].remaining()</tt> bytes are written from buffer
|
||||
* <tt>srcs[offset+1]</tt>, and so forth, until the entire byte sequence is
|
||||
* {@code 0} {@code <=} <i>n</i> {@code <=} <i>r</i>.
|
||||
* Up to the first {@code srcs[offset].remaining()} bytes of this sequence
|
||||
* are written from buffer {@code srcs[offset]}, up to the next
|
||||
* {@code srcs[offset+1].remaining()} bytes are written from buffer
|
||||
* {@code srcs[offset+1]}, and so forth, until the entire byte sequence is
|
||||
* written. As many bytes as possible are written from each buffer, hence
|
||||
* the final position of each updated buffer, except the last updated
|
||||
* buffer, is guaranteed to be equal to that buffer's limit.
|
||||
|
@ -92,17 +92,17 @@ public interface GatheringByteChannel
|
|||
* @param offset
|
||||
* The offset within the buffer array of the first buffer from
|
||||
* which bytes are to be retrieved; must be non-negative and no
|
||||
* larger than <tt>srcs.length</tt>
|
||||
* larger than {@code srcs.length}
|
||||
*
|
||||
* @param length
|
||||
* The maximum number of buffers to be accessed; must be
|
||||
* non-negative and no larger than
|
||||
* <tt>srcs.length</tt> - <tt>offset</tt>
|
||||
* {@code srcs.length} - {@code offset}
|
||||
*
|
||||
* @return The number of bytes written, possibly zero
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on the <tt>offset</tt> and <tt>length</tt>
|
||||
* If the preconditions on the {@code offset} and {@code length}
|
||||
* parameters do not hold
|
||||
*
|
||||
* @throws NonWritableChannelException
|
||||
|
@ -131,7 +131,7 @@ public interface GatheringByteChannel
|
|||
/**
|
||||
* Writes a sequence of bytes to this channel from the given buffers.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>c.write(srcs)</tt>
|
||||
* <p> An invocation of this method of the form {@code c.write(srcs)}
|
||||
* behaves in exactly the same manner as the invocation
|
||||
*
|
||||
* <blockquote><pre>
|
||||
|
|
|
@ -54,7 +54,7 @@ import java.io.IOException;
|
|||
*
|
||||
* <p> A channel supports asynchronous closing and interruption if, and only
|
||||
* if, it implements this interface. This can be tested at runtime, if
|
||||
* necessary, via the <tt>instanceof</tt> operator.
|
||||
* necessary, via the {@code instanceof} operator.
|
||||
*
|
||||
*
|
||||
* @author Mark Reinhold
|
||||
|
|
|
@ -52,16 +52,16 @@ public interface ReadableByteChannel extends Channel {
|
|||
*
|
||||
* <p> An attempt is made to read up to <i>r</i> bytes from the channel,
|
||||
* where <i>r</i> is the number of bytes remaining in the buffer, that is,
|
||||
* <tt>dst.remaining()</tt>, at the moment this method is invoked.
|
||||
* {@code dst.remaining()}, at the moment this method is invoked.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is read, where
|
||||
* <tt>0</tt> <tt><=</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* {@code 0} {@code <=} <i>n</i> {@code <=} <i>r</i>.
|
||||
* This byte sequence will be transferred into the buffer so that the first
|
||||
* byte in the sequence is at index <i>p</i> and the last byte is at index
|
||||
* <i>p</i> <tt>+</tt> <i>n</i> <tt>-</tt> <tt>1</tt>,
|
||||
* <i>p</i> {@code +} <i>n</i> {@code -} {@code 1},
|
||||
* where <i>p</i> is the buffer's position at the moment this method is
|
||||
* invoked. Upon return the buffer's position will be equal to
|
||||
* <i>p</i> <tt>+</tt> <i>n</i>; its limit will not have changed.
|
||||
* <i>p</i> {@code +} <i>n</i>; its limit will not have changed.
|
||||
*
|
||||
* <p> A read operation might not fill the buffer, and in fact it might not
|
||||
* read any bytes at all. Whether or not it does so depends upon the
|
||||
|
@ -81,7 +81,7 @@ public interface ReadableByteChannel extends Channel {
|
|||
* @param dst
|
||||
* The buffer into which bytes are to be transferred
|
||||
*
|
||||
* @return The number of bytes read, possibly zero, or <tt>-1</tt> if the
|
||||
* @return The number of bytes read, possibly zero, or {@code -1} if the
|
||||
* channel has reached end-of-stream
|
||||
*
|
||||
* @throws NonReadableChannelException
|
||||
|
|
|
@ -66,11 +66,11 @@ public interface ScatteringByteChannel
|
|||
* at the moment that this method is invoked.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is read, where
|
||||
* <tt>0</tt> <tt><=</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* Up to the first <tt>dsts[offset].remaining()</tt> bytes of this sequence
|
||||
* are transferred into buffer <tt>dsts[offset]</tt>, up to the next
|
||||
* <tt>dsts[offset+1].remaining()</tt> bytes are transferred into buffer
|
||||
* <tt>dsts[offset+1]</tt>, and so forth, until the entire byte sequence
|
||||
* {@code 0} {@code <=} <i>n</i> {@code <=} <i>r</i>.
|
||||
* Up to the first {@code dsts[offset].remaining()} bytes of this sequence
|
||||
* are transferred into buffer {@code dsts[offset]}, up to the next
|
||||
* {@code dsts[offset+1].remaining()} bytes are transferred into buffer
|
||||
* {@code dsts[offset+1]}, and so forth, until the entire byte sequence
|
||||
* is transferred into the given buffers. As many bytes as possible are
|
||||
* transferred into each buffer, hence the final position of each updated
|
||||
* buffer, except the last updated buffer, is guaranteed to be equal to
|
||||
|
@ -87,18 +87,18 @@ public interface ScatteringByteChannel
|
|||
* @param offset
|
||||
* The offset within the buffer array of the first buffer into
|
||||
* which bytes are to be transferred; must be non-negative and no
|
||||
* larger than <tt>dsts.length</tt>
|
||||
* larger than {@code dsts.length}
|
||||
*
|
||||
* @param length
|
||||
* The maximum number of buffers to be accessed; must be
|
||||
* non-negative and no larger than
|
||||
* <tt>dsts.length</tt> - <tt>offset</tt>
|
||||
* {@code dsts.length} - {@code offset}
|
||||
*
|
||||
* @return The number of bytes read, possibly zero,
|
||||
* or <tt>-1</tt> if the channel has reached end-of-stream
|
||||
* or {@code -1} if the channel has reached end-of-stream
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* If the preconditions on the <tt>offset</tt> and <tt>length</tt>
|
||||
* If the preconditions on the {@code offset} and {@code length}
|
||||
* parameters do not hold
|
||||
*
|
||||
* @throws NonReadableChannelException
|
||||
|
@ -126,7 +126,7 @@ public interface ScatteringByteChannel
|
|||
/**
|
||||
* Reads a sequence of bytes from this channel into the given buffers.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>c.read(dsts)</tt>
|
||||
* <p> An invocation of this method of the form {@code c.read(dsts)}
|
||||
* behaves in exactly the same manner as the invocation
|
||||
*
|
||||
* <blockquote><pre>
|
||||
|
@ -136,7 +136,7 @@ public interface ScatteringByteChannel
|
|||
* The buffers into which bytes are to be transferred
|
||||
*
|
||||
* @return The number of bytes read, possibly zero,
|
||||
* or <tt>-1</tt> if the channel has reached end-of-stream
|
||||
* or {@code -1} if the channel has reached end-of-stream
|
||||
*
|
||||
* @throws NonReadableChannelException
|
||||
* If this channel was not opened for reading
|
||||
|
|
|
@ -132,7 +132,7 @@ public abstract class SelectableChannel
|
|||
* of its keys have been cancelled. A channel may also remain registered
|
||||
* for some time after it is closed. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this channel is registered
|
||||
* @return {@code true} if, and only if, this channel is registered
|
||||
*/
|
||||
public abstract boolean isRegistered();
|
||||
//
|
||||
|
@ -146,7 +146,7 @@ public abstract class SelectableChannel
|
|||
* The selector
|
||||
*
|
||||
* @return The key returned when this channel was last registered with the
|
||||
* given selector, or <tt>null</tt> if this channel is not
|
||||
* given selector, or {@code null} if this channel is not
|
||||
* currently registered with that selector
|
||||
*/
|
||||
public abstract SelectionKey keyFor(Selector sel);
|
||||
|
@ -159,16 +159,16 @@ public abstract class SelectableChannel
|
|||
*
|
||||
* <p> If this channel is currently registered with the given selector then
|
||||
* the selection key representing that registration is returned. The key's
|
||||
* interest set will have been changed to <tt>ops</tt>, as if by invoking
|
||||
* interest set will have been changed to {@code ops}, as if by invoking
|
||||
* the {@link SelectionKey#interestOps(int) interestOps(int)} method. If
|
||||
* the <tt>att</tt> argument is not <tt>null</tt> then the key's attachment
|
||||
* the {@code att} argument is not {@code null} then the key's attachment
|
||||
* will have been set to that value. A {@link CancelledKeyException} will
|
||||
* be thrown if the key has already been cancelled.
|
||||
*
|
||||
* <p> Otherwise this channel has not yet been registered with the given
|
||||
* selector, so it is registered and the resulting new key is returned.
|
||||
* The key's initial interest set will be <tt>ops</tt> and its attachment
|
||||
* will be <tt>att</tt>.
|
||||
* The key's initial interest set will be {@code ops} and its attachment
|
||||
* will be {@code att}.
|
||||
*
|
||||
* <p> This method may be invoked at any time. If this method is invoked
|
||||
* while another invocation of this method or of the {@link
|
||||
|
@ -189,7 +189,7 @@ public abstract class SelectableChannel
|
|||
* The interest set for the resulting key
|
||||
*
|
||||
* @param att
|
||||
* The attachment for the resulting key; may be <tt>null</tt>
|
||||
* The attachment for the resulting key; may be {@code null}
|
||||
*
|
||||
* @throws ClosedChannelException
|
||||
* If this channel is closed
|
||||
|
@ -209,7 +209,7 @@ public abstract class SelectableChannel
|
|||
* but the corresponding key has already been cancelled
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If a bit in the <tt>ops</tt> set does not correspond to an
|
||||
* If a bit in the {@code ops} set does not correspond to an
|
||||
* operation that is supported by this channel, that is, if
|
||||
* {@code set & ~validOps() != 0}
|
||||
*
|
||||
|
@ -235,13 +235,13 @@ public abstract class SelectableChannel
|
|||
*
|
||||
* <p> An invocation of this convenience method of the form
|
||||
*
|
||||
* <blockquote><tt>sc.register(sel, ops)</tt></blockquote>
|
||||
* <blockquote>{@code sc.register(sel, ops)}</blockquote>
|
||||
*
|
||||
* behaves in exactly the same way as the invocation
|
||||
*
|
||||
* <blockquote><tt>sc.{@link
|
||||
* <blockquote>{@code sc.}{@link
|
||||
* #register(java.nio.channels.Selector,int,java.lang.Object)
|
||||
* register}(sel, ops, null)</tt></blockquote>
|
||||
* register(sel, ops, null)}</blockquote>
|
||||
*
|
||||
* @param sel
|
||||
* The selector with which this channel is to be registered
|
||||
|
@ -267,7 +267,7 @@ public abstract class SelectableChannel
|
|||
* but the corresponding key has already been cancelled
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If a bit in <tt>ops</tt> does not correspond to an operation
|
||||
* If a bit in {@code ops} does not correspond to an operation
|
||||
* that is supported by this channel, that is, if {@code set &
|
||||
* ~validOps() != 0}
|
||||
*
|
||||
|
@ -296,8 +296,8 @@ public abstract class SelectableChannel
|
|||
* of the {@link #register(Selector, int) register} method is in progress
|
||||
* then it will first block until the other operation is complete. </p>
|
||||
*
|
||||
* @param block If <tt>true</tt> then this channel will be placed in
|
||||
* blocking mode; if <tt>false</tt> then it will be placed
|
||||
* @param block If {@code true} then this channel will be placed in
|
||||
* blocking mode; if {@code false} then it will be placed
|
||||
* non-blocking mode
|
||||
*
|
||||
* @return This selectable channel
|
||||
|
@ -306,7 +306,7 @@ public abstract class SelectableChannel
|
|||
* If this channel is closed
|
||||
*
|
||||
* @throws IllegalBlockingModeException
|
||||
* If <tt>block</tt> is <tt>true</tt> and this channel is
|
||||
* If {@code block} is {@code true} and this channel is
|
||||
* registered with one or more selectors
|
||||
*
|
||||
* @throws IOException
|
||||
|
@ -327,7 +327,7 @@ public abstract class SelectableChannel
|
|||
* <p> If this channel is closed then the value returned by this method is
|
||||
* not specified. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this channel is in blocking mode
|
||||
* @return {@code true} if, and only if, this channel is in blocking mode
|
||||
*/
|
||||
public abstract boolean isBlocking();
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ public abstract class SelectionKey {
|
|||
* <p> A key is valid upon creation and remains so until it is cancelled,
|
||||
* its channel is closed, or its selector is closed. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this key is valid
|
||||
* @return {@code true} if, and only if, this key is valid
|
||||
*/
|
||||
public abstract boolean isValid();
|
||||
|
||||
|
@ -218,11 +218,11 @@ public abstract class SelectionKey {
|
|||
* Operation-set bit for read operations.
|
||||
*
|
||||
* <p> Suppose that a selection key's interest set contains
|
||||
* <tt>OP_READ</tt> at the start of a <a
|
||||
* {@code OP_READ} at the start of a <a
|
||||
* href="Selector.html#selop">selection operation</a>. If the selector
|
||||
* detects that the corresponding channel is ready for reading, has reached
|
||||
* end-of-stream, has been remotely shut down for further reading, or has
|
||||
* an error pending, then it will add <tt>OP_READ</tt> to the key's
|
||||
* an error pending, then it will add {@code OP_READ} to the key's
|
||||
* ready-operation set and add the key to its selected-key set. </p>
|
||||
*/
|
||||
public static final int OP_READ = 1 << 0;
|
||||
|
@ -231,11 +231,11 @@ public abstract class SelectionKey {
|
|||
* Operation-set bit for write operations.
|
||||
*
|
||||
* <p> Suppose that a selection key's interest set contains
|
||||
* <tt>OP_WRITE</tt> at the start of a <a
|
||||
* {@code OP_WRITE} at the start of a <a
|
||||
* href="Selector.html#selop">selection operation</a>. If the selector
|
||||
* detects that the corresponding channel is ready for writing, has been
|
||||
* remotely shut down for further writing, or has an error pending, then it
|
||||
* will add <tt>OP_WRITE</tt> to the key's ready set and add the key to its
|
||||
* will add {@code OP_WRITE} to the key's ready set and add the key to its
|
||||
* selected-key set. </p>
|
||||
*/
|
||||
public static final int OP_WRITE = 1 << 2;
|
||||
|
@ -244,11 +244,11 @@ public abstract class SelectionKey {
|
|||
* Operation-set bit for socket-connect operations.
|
||||
*
|
||||
* <p> Suppose that a selection key's interest set contains
|
||||
* <tt>OP_CONNECT</tt> at the start of a <a
|
||||
* {@code OP_CONNECT} at the start of a <a
|
||||
* href="Selector.html#selop">selection operation</a>. If the selector
|
||||
* detects that the corresponding socket channel is ready to complete its
|
||||
* connection sequence, or has an error pending, then it will add
|
||||
* <tt>OP_CONNECT</tt> to the key's ready set and add the key to its
|
||||
* {@code OP_CONNECT} to the key's ready set and add the key to its
|
||||
* selected-key set. </p>
|
||||
*/
|
||||
public static final int OP_CONNECT = 1 << 3;
|
||||
|
@ -257,11 +257,11 @@ public abstract class SelectionKey {
|
|||
* Operation-set bit for socket-accept operations.
|
||||
*
|
||||
* <p> Suppose that a selection key's interest set contains
|
||||
* <tt>OP_ACCEPT</tt> at the start of a <a
|
||||
* {@code OP_ACCEPT} at the start of a <a
|
||||
* href="Selector.html#selop">selection operation</a>. If the selector
|
||||
* detects that the corresponding server-socket channel is ready to accept
|
||||
* another connection, or has an error pending, then it will add
|
||||
* <tt>OP_ACCEPT</tt> to the key's ready set and add the key to its
|
||||
* {@code OP_ACCEPT} to the key's ready set and add the key to its
|
||||
* selected-key set. </p>
|
||||
*/
|
||||
public static final int OP_ACCEPT = 1 << 4;
|
||||
|
@ -269,7 +269,7 @@ public abstract class SelectionKey {
|
|||
/**
|
||||
* Tests whether this key's channel is ready for reading.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>k.isReadable()</tt>
|
||||
* <p> An invocation of this method of the form {@code k.isReadable()}
|
||||
* behaves in exactly the same way as the expression
|
||||
*
|
||||
* <blockquote><pre>{@code
|
||||
|
@ -277,9 +277,9 @@ public abstract class SelectionKey {
|
|||
* }</pre></blockquote>
|
||||
*
|
||||
* <p> If this key's channel does not support read operations then this
|
||||
* method always returns <tt>false</tt>. </p>
|
||||
* method always returns {@code false}. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if,
|
||||
* @return {@code true} if, and only if,
|
||||
{@code readyOps() & OP_READ} is nonzero
|
||||
*
|
||||
* @throws CancelledKeyException
|
||||
|
@ -292,7 +292,7 @@ public abstract class SelectionKey {
|
|||
/**
|
||||
* Tests whether this key's channel is ready for writing.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>k.isWritable()</tt>
|
||||
* <p> An invocation of this method of the form {@code k.isWritable()}
|
||||
* behaves in exactly the same way as the expression
|
||||
*
|
||||
* <blockquote><pre>{@code
|
||||
|
@ -300,9 +300,9 @@ public abstract class SelectionKey {
|
|||
* }</pre></blockquote>
|
||||
*
|
||||
* <p> If this key's channel does not support write operations then this
|
||||
* method always returns <tt>false</tt>. </p>
|
||||
* method always returns {@code false}. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if,
|
||||
* @return {@code true} if, and only if,
|
||||
* {@code readyOps() & OP_WRITE} is nonzero
|
||||
*
|
||||
* @throws CancelledKeyException
|
||||
|
@ -316,7 +316,7 @@ public abstract class SelectionKey {
|
|||
* Tests whether this key's channel has either finished, or failed to
|
||||
* finish, its socket-connection operation.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>k.isConnectable()</tt>
|
||||
* <p> An invocation of this method of the form {@code k.isConnectable()}
|
||||
* behaves in exactly the same way as the expression
|
||||
*
|
||||
* <blockquote><pre>{@code
|
||||
|
@ -324,9 +324,9 @@ public abstract class SelectionKey {
|
|||
* }</pre></blockquote>
|
||||
*
|
||||
* <p> If this key's channel does not support socket-connect operations
|
||||
* then this method always returns <tt>false</tt>. </p>
|
||||
* then this method always returns {@code false}. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if,
|
||||
* @return {@code true} if, and only if,
|
||||
* {@code readyOps() & OP_CONNECT} is nonzero
|
||||
*
|
||||
* @throws CancelledKeyException
|
||||
|
@ -340,7 +340,7 @@ public abstract class SelectionKey {
|
|||
* Tests whether this key's channel is ready to accept a new socket
|
||||
* connection.
|
||||
*
|
||||
* <p> An invocation of this method of the form <tt>k.isAcceptable()</tt>
|
||||
* <p> An invocation of this method of the form {@code k.isAcceptable()}
|
||||
* behaves in exactly the same way as the expression
|
||||
*
|
||||
* <blockquote><pre>{@code
|
||||
|
@ -348,9 +348,9 @@ public abstract class SelectionKey {
|
|||
* }</pre></blockquote>
|
||||
*
|
||||
* <p> If this key's channel does not support socket-accept operations then
|
||||
* this method always returns <tt>false</tt>. </p>
|
||||
* this method always returns {@code false}. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if,
|
||||
* @return {@code true} if, and only if,
|
||||
* {@code readyOps() & OP_ACCEPT} is nonzero
|
||||
*
|
||||
* @throws CancelledKeyException
|
||||
|
@ -376,13 +376,13 @@ public abstract class SelectionKey {
|
|||
* <p> An attached object may later be retrieved via the {@link #attachment()
|
||||
* attachment} method. Only one object may be attached at a time; invoking
|
||||
* this method causes any previous attachment to be discarded. The current
|
||||
* attachment may be discarded by attaching <tt>null</tt>. </p>
|
||||
* attachment may be discarded by attaching {@code null}. </p>
|
||||
*
|
||||
* @param ob
|
||||
* The object to be attached; may be <tt>null</tt>
|
||||
* The object to be attached; may be {@code null}
|
||||
*
|
||||
* @return The previously-attached object, if any,
|
||||
* otherwise <tt>null</tt>
|
||||
* otherwise {@code null}
|
||||
*/
|
||||
public final Object attach(Object ob) {
|
||||
return attachmentUpdater.getAndSet(this, ob);
|
||||
|
@ -392,7 +392,7 @@ public abstract class SelectionKey {
|
|||
* Retrieves the current attachment.
|
||||
*
|
||||
* @return The object currently attached to this key,
|
||||
* or <tt>null</tt> if there is no attachment
|
||||
* or {@code null} if there is no attachment
|
||||
*/
|
||||
public final Object attachment() {
|
||||
return attachment;
|
||||
|
|
|
@ -230,7 +230,7 @@ public abstract class Selector implements Closeable {
|
|||
/**
|
||||
* Tells whether or not this selector is open.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this selector is open
|
||||
* @return {@code true} if, and only if, this selector is open
|
||||
*/
|
||||
public abstract boolean isOpen();
|
||||
|
||||
|
@ -309,7 +309,7 @@ public abstract class Selector implements Closeable {
|
|||
* <p> This method does not offer real-time guarantees: It schedules the
|
||||
* timeout as if by invoking the {@link Object#wait(long)} method. </p>
|
||||
*
|
||||
* @param timeout If positive, block for up to <tt>timeout</tt>
|
||||
* @param timeout If positive, block for up to {@code timeout}
|
||||
* milliseconds, more or less, while waiting for a
|
||||
* channel to become ready; if zero, block indefinitely;
|
||||
* must not be negative
|
||||
|
|
|
@ -223,7 +223,7 @@ public abstract class ServerSocketChannel
|
|||
* Accepts a connection made to this channel's socket.
|
||||
*
|
||||
* <p> If this channel is in non-blocking mode then this method will
|
||||
* immediately return <tt>null</tt> if there are no pending connections.
|
||||
* immediately return {@code null} if there are no pending connections.
|
||||
* Otherwise it will block indefinitely until a new connection is available
|
||||
* or an I/O error occurs.
|
||||
*
|
||||
|
@ -239,7 +239,7 @@ public abstract class ServerSocketChannel
|
|||
* java.lang.SecurityManager#checkAccept checkAccept} method. </p>
|
||||
*
|
||||
* @return The socket channel for the new connection,
|
||||
* or <tt>null</tt> if this channel is in non-blocking mode
|
||||
* or {@code null} if this channel is in non-blocking mode
|
||||
* and no connection is available to be accepted
|
||||
*
|
||||
* @throws ClosedChannelException
|
||||
|
|
|
@ -58,7 +58,7 @@ import java.nio.channels.spi.SelectorProvider;
|
|||
* If the input side of a socket is shut down by one thread while another
|
||||
* thread is blocked in a read operation on the socket's channel, then the read
|
||||
* operation in the blocked thread will complete without reading any bytes and
|
||||
* will return <tt>-1</tt>. If the output side of a socket is shut down by one
|
||||
* will return {@code -1}. If the output side of a socket is shut down by one
|
||||
* thread while another thread is blocked in a write operation on the socket's
|
||||
* channel, then the blocked thread will receive an {@link
|
||||
* AsynchronousCloseException}.
|
||||
|
@ -150,7 +150,7 @@ public abstract class SocketChannel
|
|||
*
|
||||
* <p> This convenience method works as if by invoking the {@link #open()}
|
||||
* method, invoking the {@link #connect(SocketAddress) connect} method upon
|
||||
* the resulting socket channel, passing it <tt>remote</tt>, and then
|
||||
* the resulting socket channel, passing it {@code remote}, and then
|
||||
* returning that channel. </p>
|
||||
*
|
||||
* @param remote
|
||||
|
@ -204,9 +204,9 @@ public abstract class SocketChannel
|
|||
* operations.
|
||||
*
|
||||
* <p> Socket channels support connecting, reading, and writing, so this
|
||||
* method returns <tt>(</tt>{@link SelectionKey#OP_CONNECT}
|
||||
* <tt>|</tt> {@link SelectionKey#OP_READ} <tt>|</tt> {@link
|
||||
* SelectionKey#OP_WRITE}<tt>)</tt>. </p>
|
||||
* method returns {@code (}{@link SelectionKey#OP_CONNECT}
|
||||
* {@code |} {@link SelectionKey#OP_READ} {@code |} {@link
|
||||
* SelectionKey#OP_WRITE}{@code )}.
|
||||
*
|
||||
* @return The valid-operation set
|
||||
*/
|
||||
|
@ -304,7 +304,7 @@ public abstract class SocketChannel
|
|||
/**
|
||||
* Tells whether or not this channel's network socket is connected.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this channel's network socket
|
||||
* @return {@code true} if, and only if, this channel's network socket
|
||||
* is {@link #isOpen open} and connected
|
||||
*/
|
||||
public abstract boolean isConnected();
|
||||
|
@ -313,7 +313,7 @@ public abstract class SocketChannel
|
|||
* Tells whether or not a connection operation is in progress on this
|
||||
* channel.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, a connection operation has been
|
||||
* @return {@code true} if, and only if, a connection operation has been
|
||||
* initiated on this channel but not yet completed by invoking the
|
||||
* {@link #finishConnect finishConnect} method
|
||||
*/
|
||||
|
@ -325,8 +325,8 @@ public abstract class SocketChannel
|
|||
* <p> If this channel is in non-blocking mode then an invocation of this
|
||||
* method initiates a non-blocking connection operation. If the connection
|
||||
* is established immediately, as can happen with a local connection, then
|
||||
* this method returns <tt>true</tt>. Otherwise this method returns
|
||||
* <tt>false</tt> and the connection operation must later be completed by
|
||||
* this method returns {@code true}. Otherwise this method returns
|
||||
* {@code false} and the connection operation must later be completed by
|
||||
* invoking the {@link #finishConnect finishConnect} method.
|
||||
*
|
||||
* <p> If this channel is in blocking mode then an invocation of this
|
||||
|
@ -349,8 +349,8 @@ public abstract class SocketChannel
|
|||
* @param remote
|
||||
* The remote address to which this channel is to be connected
|
||||
*
|
||||
* @return <tt>true</tt> if a connection was established,
|
||||
* <tt>false</tt> if this channel is in non-blocking mode
|
||||
* @return {@code true} if a connection was established,
|
||||
* {@code false} if this channel is in non-blocking mode
|
||||
* and the connection operation is in progress
|
||||
*
|
||||
* @throws AlreadyConnectedException
|
||||
|
@ -400,11 +400,11 @@ public abstract class SocketChannel
|
|||
* {@link java.io.IOException} to be thrown.
|
||||
*
|
||||
* <p> If this channel is already connected then this method will not block
|
||||
* and will immediately return <tt>true</tt>. If this channel is in
|
||||
* non-blocking mode then this method will return <tt>false</tt> if the
|
||||
* and will immediately return {@code true}. If this channel is in
|
||||
* non-blocking mode then this method will return {@code false} if the
|
||||
* connection process is not yet complete. If this channel is in blocking
|
||||
* mode then this method will block until the connection either completes
|
||||
* or fails, and will always either return <tt>true</tt> or throw a checked
|
||||
* or fails, and will always either return {@code true} or throw a checked
|
||||
* exception describing the failure.
|
||||
*
|
||||
* <p> This method may be invoked at any time. If a read or write
|
||||
|
@ -414,7 +414,7 @@ public abstract class SocketChannel
|
|||
* invocation of this method throws a checked exception, then the channel
|
||||
* will be closed. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this channel's socket is now
|
||||
* @return {@code true} if, and only if, this channel's socket is now
|
||||
* connected
|
||||
*
|
||||
* @throws NoConnectionPendingException
|
||||
|
|
|
@ -54,16 +54,16 @@ public interface WritableByteChannel
|
|||
*
|
||||
* <p> An attempt is made to write up to <i>r</i> bytes to the channel,
|
||||
* where <i>r</i> is the number of bytes remaining in the buffer, that is,
|
||||
* <tt>src.remaining()</tt>, at the moment this method is invoked.
|
||||
* {@code src.remaining()}, at the moment this method is invoked.
|
||||
*
|
||||
* <p> Suppose that a byte sequence of length <i>n</i> is written, where
|
||||
* <tt>0</tt> <tt><=</tt> <i>n</i> <tt><=</tt> <i>r</i>.
|
||||
* {@code 0} {@code <=} <i>n</i> {@code <=} <i>r</i>.
|
||||
* This byte sequence will be transferred from the buffer starting at index
|
||||
* <i>p</i>, where <i>p</i> is the buffer's position at the moment this
|
||||
* method is invoked; the index of the last byte written will be
|
||||
* <i>p</i> <tt>+</tt> <i>n</i> <tt>-</tt> <tt>1</tt>.
|
||||
* <i>p</i> {@code +} <i>n</i> {@code -} {@code 1}.
|
||||
* Upon return the buffer's position will be equal to
|
||||
* <i>p</i> <tt>+</tt> <i>n</i>; its limit will not have changed.
|
||||
* <i>p</i> {@code +} <i>n</i>; its limit will not have changed.
|
||||
*
|
||||
* <p> Unless otherwise specified, a write operation will return only after
|
||||
* writing all of the <i>r</i> requested bytes. Some types of channels,
|
||||
|
|
|
@ -32,29 +32,29 @@
|
|||
*
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Lists channels and their descriptions">
|
||||
* <tr><th align="left">Channels</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top><tt><i>{@link java.nio.channels.Channel}</i></tt></td>
|
||||
* <tr><td valign=top><i>{@link java.nio.channels.Channel}</i></td>
|
||||
* <td>A nexus for I/O operations</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.ReadableByteChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.ReadableByteChannel}</i></td>
|
||||
* <td>Can read into a buffer</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.ScatteringByteChannel} </i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.ScatteringByteChannel} </i></td>
|
||||
* <td>Can read into a sequence of buffers</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.WritableByteChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.WritableByteChannel}</i></td>
|
||||
* <td>Can write from a buffer</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.GatheringByteChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.GatheringByteChannel}</i></td>
|
||||
* <td>Can write from a sequence of buffers</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.ByteChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.ByteChannel}</i></td>
|
||||
* <td>Can read/write to/from a buffer</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.SeekableByteChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.SeekableByteChannel}</i></td>
|
||||
* <td>A {@code ByteChannel} connected to an entity that contains a variable-length sequence of bytes</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.AsynchronousChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.AsynchronousChannel}</i></td>
|
||||
* <td>Supports asynchronous I/O operations.</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.AsynchronousByteChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.AsynchronousByteChannel}</i></td>
|
||||
* <td>Can read and write bytes asynchronously</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.NetworkChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.NetworkChannel}</i></td>
|
||||
* <td>A channel to a network socket</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.channels.MulticastChannel}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.channels.MulticastChannel}</i></td>
|
||||
* <td>Can join Internet Protocol (IP) multicast groups</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.Channels}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.Channels}</td>
|
||||
* <td>Utility methods for channel/stream interoperation</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
|
@ -99,8 +99,8 @@
|
|||
* Internet Protocol (IP) multicast groups.
|
||||
*
|
||||
* <p> The {@link java.nio.channels.Channels} utility class defines static methods
|
||||
* that support the interoperation of the stream classes of the <tt>{@link
|
||||
* java.io}</tt> package with the channel classes of this package. An appropriate
|
||||
* that support the interoperation of the stream classes of the {@link
|
||||
* java.io} package with the channel classes of this package. An appropriate
|
||||
* channel can be constructed from an {@link java.io.InputStream} or an {@link
|
||||
* java.io.OutputStream}, and conversely an {@link java.io.InputStream} or an
|
||||
* {@link java.io.OutputStream} can be constructed from a channel. A {@link
|
||||
|
@ -111,11 +111,11 @@
|
|||
*
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Lists file channels and their descriptions">
|
||||
* <tr><th align="left">File channels</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.FileChannel}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.FileChannel}</td>
|
||||
* <td>Reads, writes, maps, and manipulates files</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.FileLock}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.FileLock}</td>
|
||||
* <td>A lock on a (region of a) file</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.MappedByteBuffer} </tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.MappedByteBuffer} </td>
|
||||
* <td>A direct byte buffer mapped to a region of a file</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
|
@ -133,30 +133,30 @@
|
|||
* java.nio.channels.FileChannel#open open} methods, or by invoking the {@code
|
||||
* getChannel} method of a {@link java.io.FileInputStream}, {@link
|
||||
* java.io.FileOutputStream}, or {@link java.io.RandomAccessFile} to return a
|
||||
* file channel connected to the same underlying file as the <tt>{@link java.io}</tt>
|
||||
* file channel connected to the same underlying file as the {@link java.io}
|
||||
* class.
|
||||
*
|
||||
* <a name="multiplex"></a>
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Lists multiplexed, non-blocking channels and their descriptions">
|
||||
* <tr><th align="left">Multiplexed, non-blocking I/O</th><th align="left"><p>Description</th></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.SelectableChannel}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.SelectableChannel}</td>
|
||||
* <td>A channel that can be multiplexed</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.channels.DatagramChannel}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.channels.DatagramChannel}</td>
|
||||
* <td>A channel to a datagram-oriented socket</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.channels.Pipe.SinkChannel}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.channels.Pipe.SinkChannel}</td>
|
||||
* <td>The write end of a pipe</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.channels.Pipe.SourceChannel}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.channels.Pipe.SourceChannel}</td>
|
||||
* <td>The read end of a pipe</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.channels.ServerSocketChannel} </tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.channels.ServerSocketChannel} </td>
|
||||
* <td>A channel to a stream-oriented listening socket</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.channels.SocketChannel}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.channels.SocketChannel}</td>
|
||||
* <td>A channel for a stream-oriented connecting socket</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.Selector}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.Selector}</td>
|
||||
* <td>A multiplexor of selectable channels</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.SelectionKey}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.SelectionKey}</td>
|
||||
* <td>A token representing the registration <br> of a channel
|
||||
* with a selector</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.Pipe}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.Pipe}</td>
|
||||
* <td>Two channels that form a unidirectional pipe</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
|
@ -194,18 +194,18 @@
|
|||
*
|
||||
* <p> This package defines selectable-channel classes corresponding to the {@link
|
||||
* java.net.DatagramSocket}, {@link java.net.ServerSocket}, and {@link
|
||||
* java.net.Socket} classes defined in the <tt>{@link java.net}</tt> package.
|
||||
* java.net.Socket} classes defined in the {@link java.net} package.
|
||||
* Minor changes to these classes have been made in order to support sockets that
|
||||
* are associated with channels. This package also defines a simple class that
|
||||
* implements unidirectional pipes. In all cases, a new selectable channel is
|
||||
* created by invoking the static <tt>open</tt> method of the corresponding class.
|
||||
* created by invoking the static {@code open} method of the corresponding class.
|
||||
* If a channel needs an associated socket then a socket will be created as a side
|
||||
* effect of this operation.
|
||||
*
|
||||
* <p> The implementation of selectors, selectable channels, and selection keys
|
||||
* can be replaced by "plugging in" an alternative definition or instance of the
|
||||
* {@link java.nio.channels.spi.SelectorProvider} class defined in the <tt>{@link
|
||||
* java.nio.channels.spi}</tt> package. It is not expected that many developers
|
||||
* {@link java.nio.channels.spi.SelectorProvider} class defined in the {@link
|
||||
* java.nio.channels.spi} package. It is not expected that many developers
|
||||
* will actually make use of this facility; it is provided primarily so that
|
||||
* sophisticated users can take advantage of operating-system-specific
|
||||
* I/O-multiplexing mechanisms when very high performance is required.
|
||||
|
@ -215,8 +215,8 @@
|
|||
* java.nio.channels.spi.AbstractInterruptibleChannel}, {@link
|
||||
* java.nio.channels.spi.AbstractSelectableChannel}, {@link
|
||||
* java.nio.channels.spi.AbstractSelectionKey}, and {@link
|
||||
* java.nio.channels.spi.AbstractSelector} classes in the <tt>{@link
|
||||
* java.nio.channels.spi}</tt> package. When defining a custom selector provider,
|
||||
* java.nio.channels.spi.AbstractSelector} classes in the {@link
|
||||
* java.nio.channels.spi} package. When defining a custom selector provider,
|
||||
* only the {@link java.nio.channels.spi.AbstractSelector} and {@link
|
||||
* java.nio.channels.spi.AbstractSelectionKey} classes should be subclassed
|
||||
* directly; custom channel classes should extend the appropriate {@link
|
||||
|
@ -226,15 +226,15 @@
|
|||
*
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Lists asynchronous channels and their descriptions">
|
||||
* <tr><th align="left">Asynchronous I/O</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousFileChannel}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.AsynchronousFileChannel}</td>
|
||||
* <td>An asynchronous channel for reading, writing, and manipulating a file</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousSocketChannel}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.AsynchronousSocketChannel}</td>
|
||||
* <td>An asynchronous channel to a stream-oriented connecting socket</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousServerSocketChannel} </tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.AsynchronousServerSocketChannel} </td>
|
||||
* <td>An asynchronous channel to a stream-oriented listening socket</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.CompletionHandler}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.CompletionHandler}</td>
|
||||
* <td>A handler for consuming the result of an asynchronous operation</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousChannelGroup}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.channels.AsynchronousChannelGroup}</td>
|
||||
* <td>A grouping of asynchronous channels for the purpose of resource sharing</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
|
@ -272,13 +272,13 @@
|
|||
* <p> As with selectors, the implementation of asynchronous channels can be
|
||||
* replaced by "plugging in" an alternative definition or instance of the {@link
|
||||
* java.nio.channels.spi.AsynchronousChannelProvider} class defined in the
|
||||
* <tt>{@link java.nio.channels.spi}</tt> package. It is not expected that many
|
||||
* {@link java.nio.channels.spi} package. It is not expected that many
|
||||
* developers will actually make use of this facility; it is provided primarily
|
||||
* so that sophisticated users can take advantage of operating-system-specific
|
||||
* asynchronous I/O mechanisms when very high performance is required.
|
||||
*
|
||||
* <hr width="80%">
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
|
||||
* <p> Unless otherwise noted, passing a {@code null} argument to a constructor
|
||||
* or method in any class or interface in this package will cause a {@link
|
||||
* java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
*
|
||||
|
|
|
@ -46,7 +46,7 @@ import sun.nio.ch.Interruptible;
|
|||
* before and after, respectively, invoking an I/O operation that might block
|
||||
* indefinitely. In order to ensure that the {@link #end end} method is always
|
||||
* invoked, these methods should be used within a
|
||||
* <tt>try</tt> ... <tt>finally</tt> block:
|
||||
* {@code try} ... {@code finally} block:
|
||||
*
|
||||
* <blockquote><pre>
|
||||
* boolean completed = false;
|
||||
|
@ -58,11 +58,11 @@ import sun.nio.ch.Interruptible;
|
|||
* end(completed);
|
||||
* }</pre></blockquote>
|
||||
*
|
||||
* <p> The <tt>completed</tt> argument to the {@link #end end} method tells
|
||||
* <p> The {@code completed} argument to the {@link #end end} method tells
|
||||
* whether or not the I/O operation actually completed, that is, whether it had
|
||||
* any effect that would be visible to the invoker. In the case of an
|
||||
* operation that reads bytes, for example, this argument should be
|
||||
* <tt>true</tt> if, and only if, some bytes were actually transferred into the
|
||||
* {@code true} if, and only if, some bytes were actually transferred into the
|
||||
* invoker's target buffer.
|
||||
*
|
||||
* <p> A concrete channel class must also implement the {@link
|
||||
|
@ -148,7 +148,7 @@ public abstract class AbstractInterruptibleChannel
|
|||
* Marks the beginning of an I/O operation that might block indefinitely.
|
||||
*
|
||||
* <p> This method should be invoked in tandem with the {@link #end end}
|
||||
* method, using a <tt>try</tt> ... <tt>finally</tt> block as
|
||||
* method, using a {@code try} ... {@code finally} block as
|
||||
* shown <a href="#be">above</a>, in order to implement asynchronous
|
||||
* closing and interruption for this channel. </p>
|
||||
*/
|
||||
|
@ -177,12 +177,12 @@ public abstract class AbstractInterruptibleChannel
|
|||
* Marks the end of an I/O operation that might block indefinitely.
|
||||
*
|
||||
* <p> This method should be invoked in tandem with the {@link #begin
|
||||
* begin} method, using a <tt>try</tt> ... <tt>finally</tt> block
|
||||
* begin} method, using a {@code try} ... {@code finally} block
|
||||
* as shown <a href="#be">above</a>, in order to implement asynchronous
|
||||
* closing and interruption for this channel. </p>
|
||||
*
|
||||
* @param completed
|
||||
* <tt>true</tt> if, and only if, the I/O operation completed
|
||||
* {@code true} if, and only if, the I/O operation completed
|
||||
* successfully, that is, had some effect that would be visible to
|
||||
* the operation's invoker
|
||||
*
|
||||
|
|
|
@ -305,8 +305,8 @@ public abstract class AbstractSelectableChannel
|
|||
* changing the blocking mode. This method is only invoked if the new mode
|
||||
* is different from the current mode. </p>
|
||||
*
|
||||
* @param block If <tt>true</tt> then this channel will be placed in
|
||||
* blocking mode; if <tt>false</tt> then it will be placed
|
||||
* @param block If {@code true} then this channel will be placed in
|
||||
* blocking mode; if {@code false} then it will be placed
|
||||
* non-blocking mode
|
||||
*
|
||||
* @throws IOException
|
||||
|
|
|
@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
* after, respectively, invoking an I/O operation that might block
|
||||
* indefinitely. In order to ensure that the {@link #end end} method is always
|
||||
* invoked, these methods should be used within a
|
||||
* <tt>try</tt> ... <tt>finally</tt> block:
|
||||
* {@code try} ... {@code finally} block:
|
||||
*
|
||||
* <blockquote><pre>
|
||||
* try {
|
||||
|
@ -197,7 +197,7 @@ public abstract class AbstractSelector
|
|||
* Marks the beginning of an I/O operation that might block indefinitely.
|
||||
*
|
||||
* <p> This method should be invoked in tandem with the {@link #end end}
|
||||
* method, using a <tt>try</tt> ... <tt>finally</tt> block as
|
||||
* method, using a {@code try} ... {@code finally} block as
|
||||
* shown <a href="#be">above</a>, in order to implement interruption for
|
||||
* this selector.
|
||||
*
|
||||
|
@ -223,7 +223,7 @@ public abstract class AbstractSelector
|
|||
* Marks the end of an I/O operation that might block indefinitely.
|
||||
*
|
||||
* <p> This method should be invoked in tandem with the {@link #begin begin}
|
||||
* method, using a <tt>try</tt> ... <tt>finally</tt> block as
|
||||
* method, using a {@code try} ... {@code finally} block as
|
||||
* shown <a href="#be">above</a>, in order to implement interruption for
|
||||
* this selector. </p>
|
||||
*/
|
||||
|
|
|
@ -64,7 +64,7 @@ public abstract class AsynchronousChannelProvider {
|
|||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed and it denies
|
||||
* {@link RuntimePermission}<tt>("asynchronousChannelProvider")</tt>
|
||||
* {@link RuntimePermission}{@code ("asynchronousChannelProvider")}
|
||||
*/
|
||||
protected AsynchronousChannelProvider() {
|
||||
this(checkPermission());
|
||||
|
@ -137,7 +137,7 @@ public abstract class AsynchronousChannelProvider {
|
|||
* <ol>
|
||||
*
|
||||
* <li><p> If the system property
|
||||
* <tt>java.nio.channels.spi.AsynchronousChannelProvider</tt> is defined
|
||||
* {@code java.nio.channels.spi.AsynchronousChannelProvider} is defined
|
||||
* then it is taken to be the fully-qualified name of a concrete provider class.
|
||||
* The class is loaded and instantiated; if this process fails then an
|
||||
* unspecified error is thrown. </p></li>
|
||||
|
@ -145,8 +145,8 @@ public abstract class AsynchronousChannelProvider {
|
|||
* <li><p> If a provider class has been installed in a jar file that is
|
||||
* visible to the system class loader, and that jar file contains a
|
||||
* provider-configuration file named
|
||||
* <tt>java.nio.channels.spi.AsynchronousChannelProvider</tt> in the resource
|
||||
* directory <tt>META-INF/services</tt>, then the first class name
|
||||
* {@code java.nio.channels.spi.AsynchronousChannelProvider} in the resource
|
||||
* directory {@code META-INF/services}, then the first class name
|
||||
* specified in that file is taken. The class is loaded and
|
||||
* instantiated; if this process fails then an unspecified error is
|
||||
* thrown. </p></li>
|
||||
|
|
|
@ -46,7 +46,7 @@ import sun.security.action.GetPropertyAction;
|
|||
* #provider() provider} method. The first invocation of that method will locate
|
||||
* the default provider as specified below.
|
||||
*
|
||||
* <p> The system-wide default provider is used by the static <tt>open</tt>
|
||||
* <p> The system-wide default provider is used by the static {@code open}
|
||||
* methods of the {@link java.nio.channels.DatagramChannel#open
|
||||
* DatagramChannel}, {@link java.nio.channels.Pipe#open Pipe}, {@link
|
||||
* java.nio.channels.Selector#open Selector}, {@link
|
||||
|
@ -54,7 +54,7 @@ import sun.security.action.GetPropertyAction;
|
|||
* java.nio.channels.SocketChannel#open SocketChannel} classes. It is also
|
||||
* used by the {@link java.lang.System#inheritedChannel System.inheritedChannel()}
|
||||
* method. A program may make use of a provider other than the default provider
|
||||
* by instantiating that provider and then directly invoking the <tt>open</tt>
|
||||
* by instantiating that provider and then directly invoking the {@code open}
|
||||
* methods defined in this class.
|
||||
*
|
||||
* <p> All of the methods in this class are safe for use by multiple concurrent
|
||||
|
@ -84,7 +84,7 @@ public abstract class SelectorProvider {
|
|||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed and it denies
|
||||
* {@link RuntimePermission}<tt>("selectorProvider")</tt>
|
||||
* {@link RuntimePermission}{@code ("selectorProvider")}
|
||||
*/
|
||||
protected SelectorProvider() {
|
||||
this(checkPermission());
|
||||
|
@ -142,7 +142,7 @@ public abstract class SelectorProvider {
|
|||
* <ol>
|
||||
*
|
||||
* <li><p> If the system property
|
||||
* <tt>java.nio.channels.spi.SelectorProvider</tt> is defined then it is
|
||||
* {@code java.nio.channels.spi.SelectorProvider} is defined then it is
|
||||
* taken to be the fully-qualified name of a concrete provider class.
|
||||
* The class is loaded and instantiated; if this process fails then an
|
||||
* unspecified error is thrown. </p></li>
|
||||
|
@ -150,8 +150,8 @@ public abstract class SelectorProvider {
|
|||
* <li><p> If a provider class has been installed in a jar file that is
|
||||
* visible to the system class loader, and that jar file contains a
|
||||
* provider-configuration file named
|
||||
* <tt>java.nio.channels.spi.SelectorProvider</tt> in the resource
|
||||
* directory <tt>META-INF/services</tt>, then the first class name
|
||||
* {@code java.nio.channels.spi.SelectorProvider} in the resource
|
||||
* directory {@code META-INF/services}, then the first class name
|
||||
* specified in that file is taken. The class is loaded and
|
||||
* instantiated; if this process fails then an unspecified error is
|
||||
* thrown. </p></li>
|
||||
|
@ -305,14 +305,14 @@ public abstract class SelectorProvider {
|
|||
* returned. Subsequent invocations of this method return the same
|
||||
* channel. </p>
|
||||
*
|
||||
* @return The inherited channel, if any, otherwise <tt>null</tt>.
|
||||
* @return The inherited channel, if any, otherwise {@code null}.
|
||||
*
|
||||
* @throws IOException
|
||||
* If an I/O error occurs
|
||||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed and it denies
|
||||
* {@link RuntimePermission}<tt>("inheritedChannel")</tt>
|
||||
* {@link RuntimePermission}{@code ("inheritedChannel")}
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
|
|
|
@ -55,12 +55,12 @@ import java.util.Arrays;
|
|||
* has not been used before; </p></li>
|
||||
*
|
||||
* <li><p> Invoke the {@link #$code$ $code$} method zero or more times, as
|
||||
* long as additional input may be available, passing <tt>false</tt> for the
|
||||
* <tt>endOfInput</tt> argument and filling the input buffer and flushing the
|
||||
* long as additional input may be available, passing {@code false} for the
|
||||
* {@code endOfInput} argument and filling the input buffer and flushing the
|
||||
* output buffer between invocations; </p></li>
|
||||
*
|
||||
* <li><p> Invoke the {@link #$code$ $code$} method one final time, passing
|
||||
* <tt>true</tt> for the <tt>endOfInput</tt> argument; and then </p></li>
|
||||
* {@code true} for the {@code endOfInput} argument; and then </p></li>
|
||||
*
|
||||
* <li><p> Invoke the {@link #flush flush} method so that the $coder$ can
|
||||
* flush any internal state to the output buffer. </p></li>
|
||||
|
@ -175,7 +175,7 @@ public abstract class Charset$Coder$ {
|
|||
* $otype$s that will be produced for each input $itype$
|
||||
*
|
||||
* @param replacement
|
||||
* The initial replacement; must not be <tt>null</tt>, must have
|
||||
* The initial replacement; must not be {@code null}, must have
|
||||
* non-zero length, must not be longer than max$ItypesPerOtype$,
|
||||
* and must be {@linkplain #isLegalReplacement legal}
|
||||
*
|
||||
|
@ -248,7 +248,7 @@ public abstract class Charset$Coder$ {
|
|||
* Returns this $coder$'s replacement value.
|
||||
*
|
||||
* @return This $coder$'s current replacement,
|
||||
* which is never <tt>null</tt> and is never empty
|
||||
* which is never {@code null} and is never empty
|
||||
*/
|
||||
public final $replType$ replacement() {
|
||||
#if[decoder]
|
||||
|
@ -267,7 +267,7 @@ public abstract class Charset$Coder$ {
|
|||
* replacement is acceptable. </p>
|
||||
*
|
||||
* @param newReplacement The new replacement; must not be
|
||||
* <tt>null</tt>, must have non-zero length,
|
||||
* {@code null}, must have non-zero length,
|
||||
#if[decoder]
|
||||
* and must not be longer than the value returned by the
|
||||
* {@link #max$ItypesPerOtype$() max$ItypesPerOtype$} method
|
||||
|
@ -332,7 +332,7 @@ public abstract class Charset$Coder$ {
|
|||
*
|
||||
* @param repl The byte array to be tested
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, the given byte array
|
||||
* @return {@code true} if, and only if, the given byte array
|
||||
* is a legal replacement value for this encoder
|
||||
*/
|
||||
public boolean isLegalReplacement(byte[] repl) {
|
||||
|
@ -358,7 +358,7 @@ public abstract class Charset$Coder$ {
|
|||
/**
|
||||
* Returns this $coder$'s current action for malformed-input errors.
|
||||
*
|
||||
* @return The current malformed-input action, which is never <tt>null</tt>
|
||||
* @return The current malformed-input action, which is never {@code null}
|
||||
*/
|
||||
public CodingErrorAction malformedInputAction() {
|
||||
return malformedInputAction;
|
||||
|
@ -370,7 +370,7 @@ public abstract class Charset$Coder$ {
|
|||
* <p> This method invokes the {@link #implOnMalformedInput
|
||||
* implOnMalformedInput} method, passing the new action. </p>
|
||||
*
|
||||
* @param newAction The new action; must not be <tt>null</tt>
|
||||
* @param newAction The new action; must not be {@code null}
|
||||
*
|
||||
* @return This $coder$
|
||||
*
|
||||
|
@ -400,7 +400,7 @@ public abstract class Charset$Coder$ {
|
|||
* Returns this $coder$'s current action for unmappable-character errors.
|
||||
*
|
||||
* @return The current unmappable-character action, which is never
|
||||
* <tt>null</tt>
|
||||
* {@code null}
|
||||
*/
|
||||
public CodingErrorAction unmappableCharacterAction() {
|
||||
return unmappableCharacterAction;
|
||||
|
@ -412,7 +412,7 @@ public abstract class Charset$Coder$ {
|
|||
* <p> This method invokes the {@link #implOnUnmappableCharacter
|
||||
* implOnUnmappableCharacter} method, passing the new action. </p>
|
||||
*
|
||||
* @param newAction The new action; must not be <tt>null</tt>
|
||||
* @param newAction The new action; must not be {@code null}
|
||||
*
|
||||
* @return This $coder$
|
||||
*
|
||||
|
@ -521,16 +521,16 @@ public abstract class Charset$Coder$ {
|
|||
* operation then care should be taken to preserve any $itype$s remaining
|
||||
* in the input buffer so that they are available to the next invocation.
|
||||
*
|
||||
* <p> The <tt>endOfInput</tt> parameter advises this method as to whether
|
||||
* <p> The {@code endOfInput} parameter advises this method as to whether
|
||||
* the invoker can provide further input beyond that contained in the given
|
||||
* input buffer. If there is a possibility of providing additional input
|
||||
* then the invoker should pass <tt>false</tt> for this parameter; if there
|
||||
* then the invoker should pass {@code false} for this parameter; if there
|
||||
* is no possibility of providing further input then the invoker should
|
||||
* pass <tt>true</tt>. It is not erroneous, and in fact it is quite
|
||||
* common, to pass <tt>false</tt> in one invocation and later discover that
|
||||
* pass {@code true}. It is not erroneous, and in fact it is quite
|
||||
* common, to pass {@code false} in one invocation and later discover that
|
||||
* no further input was actually available. It is critical, however, that
|
||||
* the final invocation of this method in a sequence of invocations always
|
||||
* pass <tt>true</tt> so that any remaining un$code$d input will be treated
|
||||
* pass {@code true} so that any remaining un$code$d input will be treated
|
||||
* as being malformed.
|
||||
*
|
||||
* <p> This method works by invoking the {@link #$code$Loop $code$Loop}
|
||||
|
@ -545,7 +545,7 @@ public abstract class Charset$Coder$ {
|
|||
* The output $otype$ buffer
|
||||
*
|
||||
* @param endOfInput
|
||||
* <tt>true</tt> if, and only if, the invoker can provide no
|
||||
* {@code true} if, and only if, the invoker can provide no
|
||||
* additional input $itype$s beyond those in the given buffer
|
||||
*
|
||||
* @return A coder-result object describing the reason for termination
|
||||
|
@ -553,9 +553,9 @@ public abstract class Charset$Coder$ {
|
|||
* @throws IllegalStateException
|
||||
* If $a$ $coding$ operation is already in progress and the previous
|
||||
* step was an invocation neither of the {@link #reset reset}
|
||||
* method, nor of this method with a value of <tt>false</tt> for
|
||||
* the <tt>endOfInput</tt> parameter, nor of this method with a
|
||||
* value of <tt>true</tt> for the <tt>endOfInput</tt> parameter
|
||||
* method, nor of this method with a value of {@code false} for
|
||||
* the {@code endOfInput} parameter, nor of this method with a
|
||||
* value of {@code true} for the {@code endOfInput} parameter
|
||||
* but a return value indicating an incomplete $coding$ operation
|
||||
*
|
||||
* @throws CoderMalfunctionError
|
||||
|
@ -659,7 +659,7 @@ public abstract class Charset$Coder$ {
|
|||
* invocation neither of the {@link #flush flush} method nor of
|
||||
* the three-argument {@link
|
||||
* #$code$($Itype$Buffer,$Otype$Buffer,boolean) $code$} method
|
||||
* with a value of <tt>true</tt> for the <tt>endOfInput</tt>
|
||||
* with a value of {@code true} for the {@code endOfInput}
|
||||
* parameter
|
||||
*/
|
||||
public final CoderResult flush($Otype$Buffer out) {
|
||||
|
@ -824,10 +824,10 @@ public abstract class Charset$Coder$ {
|
|||
* Tells whether or not this decoder implements an auto-detecting charset.
|
||||
*
|
||||
* <p> The default implementation of this method always returns
|
||||
* <tt>false</tt>; it should be overridden by auto-detecting decoders to
|
||||
* return <tt>true</tt>. </p>
|
||||
* {@code false}; it should be overridden by auto-detecting decoders to
|
||||
* return {@code true}. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this decoder implements an
|
||||
* @return {@code true} if, and only if, this decoder implements an
|
||||
* auto-detecting charset
|
||||
*/
|
||||
public boolean isAutoDetecting() {
|
||||
|
@ -840,21 +840,21 @@ public abstract class Charset$Coder$ {
|
|||
*
|
||||
* <p> If this decoder implements an auto-detecting charset then at a
|
||||
* single point during a decoding operation this method may start returning
|
||||
* <tt>true</tt> to indicate that a specific charset has been detected in
|
||||
* {@code true} to indicate that a specific charset has been detected in
|
||||
* the input byte sequence. Once this occurs, the {@link #detectedCharset
|
||||
* detectedCharset} method may be invoked to retrieve the detected charset.
|
||||
*
|
||||
* <p> That this method returns <tt>false</tt> does not imply that no bytes
|
||||
* <p> That this method returns {@code false} does not imply that no bytes
|
||||
* have yet been decoded. Some auto-detecting decoders are capable of
|
||||
* decoding some, or even all, of an input byte sequence without fixing on
|
||||
* a particular charset.
|
||||
*
|
||||
* <p> The default implementation of this method always throws an {@link
|
||||
* UnsupportedOperationException}; it should be overridden by
|
||||
* auto-detecting decoders to return <tt>true</tt> once the input charset
|
||||
* auto-detecting decoders to return {@code true} once the input charset
|
||||
* has been determined. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this decoder has detected a
|
||||
* @return {@code true} if, and only if, this decoder has detected a
|
||||
* specific charset
|
||||
*
|
||||
* @throws UnsupportedOperationException
|
||||
|
@ -880,7 +880,7 @@ public abstract class Charset$Coder$ {
|
|||
* auto-detecting decoders to return the appropriate value. </p>
|
||||
*
|
||||
* @return The charset detected by this auto-detecting decoder,
|
||||
* or <tt>null</tt> if the charset has not yet been determined
|
||||
* or {@code null} if the charset has not yet been determined
|
||||
*
|
||||
* @throws IllegalStateException
|
||||
* If insufficient bytes have been read to determine a charset
|
||||
|
@ -920,7 +920,7 @@ public abstract class Charset$Coder$ {
|
|||
/**
|
||||
* Tells whether or not this encoder can encode the given character.
|
||||
*
|
||||
* <p> This method returns <tt>false</tt> if the given character is a
|
||||
* <p> This method returns {@code false} if the given character is a
|
||||
* surrogate character; such characters can be interpreted only when they
|
||||
* are members of a pair consisting of a high surrogate followed by a low
|
||||
* surrogate. The {@link #canEncode(java.lang.CharSequence)
|
||||
|
@ -937,7 +937,7 @@ public abstract class Charset$Coder$ {
|
|||
* @param c
|
||||
* The given character
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this encoder can encode
|
||||
* @return {@code true} if, and only if, this encoder can encode
|
||||
* the given character
|
||||
*
|
||||
* @throws IllegalStateException
|
||||
|
@ -954,7 +954,7 @@ public abstract class Charset$Coder$ {
|
|||
* Tells whether or not this encoder can encode the given character
|
||||
* sequence.
|
||||
*
|
||||
* <p> If this method returns <tt>false</tt> for a particular character
|
||||
* <p> If this method returns {@code false} for a particular character
|
||||
* sequence then more information about why the sequence cannot be encoded
|
||||
* may be obtained by performing a full <a href="#steps">encoding
|
||||
* operation</a>.
|
||||
|
@ -968,7 +968,7 @@ public abstract class Charset$Coder$ {
|
|||
* @param cs
|
||||
* The given character sequence
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this encoder can encode
|
||||
* @return {@code true} if, and only if, this encoder can encode
|
||||
* the given character without throwing any exceptions and without
|
||||
* performing any replacements
|
||||
*
|
||||
|
|
|
@ -73,29 +73,29 @@ import sun.security.action.GetPropertyAction;
|
|||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li> The uppercase letters <tt>'A'</tt> through <tt>'Z'</tt>
|
||||
* (<tt>'\u0041'</tt> through <tt>'\u005a'</tt>),
|
||||
* <li> The uppercase letters {@code 'A'} through {@code 'Z'}
|
||||
* (<code>'\u0041'</code> through <code>'\u005a'</code>),
|
||||
*
|
||||
* <li> The lowercase letters <tt>'a'</tt> through <tt>'z'</tt>
|
||||
* (<tt>'\u0061'</tt> through <tt>'\u007a'</tt>),
|
||||
* <li> The lowercase letters {@code 'a'} through {@code 'z'}
|
||||
* (<code>'\u0061'</code> through <code>'\u007a'</code>),
|
||||
*
|
||||
* <li> The digits <tt>'0'</tt> through <tt>'9'</tt>
|
||||
* (<tt>'\u0030'</tt> through <tt>'\u0039'</tt>),
|
||||
* <li> The digits {@code '0'} through {@code '9'}
|
||||
* (<code>'\u0030'</code> through <code>'\u0039'</code>),
|
||||
*
|
||||
* <li> The dash character <tt>'-'</tt>
|
||||
* (<tt>'\u002d'</tt>, <small>HYPHEN-MINUS</small>),
|
||||
* <li> The dash character {@code '-'}
|
||||
* (<code>'\u002d'</code>, <small>HYPHEN-MINUS</small>),
|
||||
*
|
||||
* <li> The plus character <tt>'+'</tt>
|
||||
* (<tt>'\u002b'</tt>, <small>PLUS SIGN</small>),
|
||||
* <li> The plus character {@code '+'}
|
||||
* (<code>'\u002b'</code>, <small>PLUS SIGN</small>),
|
||||
*
|
||||
* <li> The period character <tt>'.'</tt>
|
||||
* (<tt>'\u002e'</tt>, <small>FULL STOP</small>),
|
||||
* <li> The period character {@code '.'}
|
||||
* (<code>'\u002e'</code>, <small>FULL STOP</small>),
|
||||
*
|
||||
* <li> The colon character <tt>':'</tt>
|
||||
* (<tt>'\u003a'</tt>, <small>COLON</small>), and
|
||||
* <li> The colon character {@code ':'}
|
||||
* (<code>'\u003a'</code>, <small>COLON</small>), and
|
||||
*
|
||||
* <li> The underscore character <tt>'_'</tt>
|
||||
* (<tt>'\u005f'</tt>, <small>LOW LINE</small>).
|
||||
* <li> The underscore character {@code '_'}
|
||||
* (<code>'\u005f'</code>, <small>LOW LINE</small>).
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
|
@ -115,7 +115,7 @@ import sun.security.action.GetPropertyAction;
|
|||
* <p><a name="hn">Some charsets have an <i>historical name</i> that is defined for
|
||||
* compatibility with previous versions of the Java platform.</a> A charset's
|
||||
* historical name is either its canonical name or one of its aliases. The
|
||||
* historical name is returned by the <tt>getEncoding()</tt> methods of the
|
||||
* historical name is returned by the {@code getEncoding()} methods of the
|
||||
* {@link java.io.InputStreamReader#getEncoding InputStreamReader} and {@link
|
||||
* java.io.OutputStreamWriter#getEncoding OutputStreamWriter} classes.
|
||||
*
|
||||
|
@ -128,7 +128,7 @@ import sun.security.action.GetPropertyAction;
|
|||
* than one registry name then its canonical name must be the MIME-preferred
|
||||
* name and the other names in the registry must be valid aliases. If a
|
||||
* supported charset is not listed in the IANA registry then its canonical name
|
||||
* must begin with one of the strings <tt>"X-"</tt> or <tt>"x-"</tt>.
|
||||
* must begin with one of the strings {@code "X-"} or {@code "x-"}.
|
||||
*
|
||||
* <p> The IANA charset registry does change over time, and so the canonical
|
||||
* name and the aliases of a particular charset may also change over time. To
|
||||
|
@ -148,53 +148,53 @@ import sun.security.action.GetPropertyAction;
|
|||
*
|
||||
* <blockquote><table width="80%" summary="Description of standard charsets">
|
||||
* <tr><th align="left">Charset</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top><tt>US-ASCII</tt></td>
|
||||
* <td>Seven-bit ASCII, a.k.a. <tt>ISO646-US</tt>,
|
||||
* <tr><td valign=top>{@code US-ASCII}</td>
|
||||
* <td>Seven-bit ASCII, a.k.a. {@code ISO646-US},
|
||||
* a.k.a. the Basic Latin block of the Unicode character set</td></tr>
|
||||
* <tr><td valign=top><tt>ISO-8859-1 </tt></td>
|
||||
* <td>ISO Latin Alphabet No. 1, a.k.a. <tt>ISO-LATIN-1</tt></td></tr>
|
||||
* <tr><td valign=top><tt>UTF-8</tt></td>
|
||||
* <tr><td valign=top><code>ISO-8859-1 </code></td>
|
||||
* <td>ISO Latin Alphabet No. 1, a.k.a. {@code ISO-LATIN-1}</td></tr>
|
||||
* <tr><td valign=top>{@code UTF-8}</td>
|
||||
* <td>Eight-bit UCS Transformation Format</td></tr>
|
||||
* <tr><td valign=top><tt>UTF-16BE</tt></td>
|
||||
* <tr><td valign=top>{@code UTF-16BE}</td>
|
||||
* <td>Sixteen-bit UCS Transformation Format,
|
||||
* big-endian byte order</td></tr>
|
||||
* <tr><td valign=top><tt>UTF-16LE</tt></td>
|
||||
* <tr><td valign=top>{@code UTF-16LE}</td>
|
||||
* <td>Sixteen-bit UCS Transformation Format,
|
||||
* little-endian byte order</td></tr>
|
||||
* <tr><td valign=top><tt>UTF-16</tt></td>
|
||||
* <tr><td valign=top>{@code UTF-16}</td>
|
||||
* <td>Sixteen-bit UCS Transformation Format,
|
||||
* byte order identified by an optional byte-order mark</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
* <p> The <tt>UTF-8</tt> charset is specified by <a
|
||||
* <p> The {@code UTF-8} charset is specified by <a
|
||||
* href="http://www.ietf.org/rfc/rfc2279.txt"><i>RFC 2279</i></a>; the
|
||||
* transformation format upon which it is based is specified in
|
||||
* Amendment 2 of ISO 10646-1 and is also described in the <a
|
||||
* href="http://www.unicode.org/unicode/standard/standard.html"><i>Unicode
|
||||
* Standard</i></a>.
|
||||
*
|
||||
* <p> The <tt>UTF-16</tt> charsets are specified by <a
|
||||
* <p> The {@code UTF-16} charsets are specified by <a
|
||||
* href="http://www.ietf.org/rfc/rfc2781.txt"><i>RFC 2781</i></a>; the
|
||||
* transformation formats upon which they are based are specified in
|
||||
* Amendment 1 of ISO 10646-1 and are also described in the <a
|
||||
* href="http://www.unicode.org/unicode/standard/standard.html"><i>Unicode
|
||||
* Standard</i></a>.
|
||||
*
|
||||
* <p> The <tt>UTF-16</tt> charsets use sixteen-bit quantities and are
|
||||
* <p> The {@code UTF-16} charsets use sixteen-bit quantities and are
|
||||
* therefore sensitive to byte order. In these encodings the byte order of a
|
||||
* stream may be indicated by an initial <i>byte-order mark</i> represented by
|
||||
* the Unicode character <tt>'\uFEFF'</tt>. Byte-order marks are handled
|
||||
* the Unicode character <code>'\uFEFF'</code>. Byte-order marks are handled
|
||||
* as follows:
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li><p> When decoding, the <tt>UTF-16BE</tt> and <tt>UTF-16LE</tt>
|
||||
* <li><p> When decoding, the {@code UTF-16BE} and {@code UTF-16LE}
|
||||
* charsets interpret the initial byte-order marks as a <small>ZERO-WIDTH
|
||||
* NON-BREAKING SPACE</small>; when encoding, they do not write
|
||||
* byte-order marks. </p></li>
|
||||
|
||||
*
|
||||
* <li><p> When decoding, the <tt>UTF-16</tt> charset interprets the
|
||||
* <li><p> When decoding, the {@code UTF-16} charset interprets the
|
||||
* byte-order mark at the beginning of the input stream to indicate the
|
||||
* byte-order of the stream but defaults to big-endian if there is no
|
||||
* byte-order mark; when encoding, it uses big-endian byte order and writes
|
||||
|
@ -247,9 +247,9 @@ import sun.security.action.GetPropertyAction;
|
|||
* character-encoding scheme then the corresponding charset is usually
|
||||
* named for the coded character set; otherwise a charset is usually named
|
||||
* for the encoding scheme and, possibly, the locale of the coded
|
||||
* character sets that it supports. Hence <tt>US-ASCII</tt> is both the
|
||||
* character sets that it supports. Hence {@code US-ASCII} is both the
|
||||
* name of a coded character set and of the charset that encodes it, while
|
||||
* <tt>EUC-JP</tt> is the name of the charset that encodes the
|
||||
* {@code EUC-JP} is the name of the charset that encodes the
|
||||
* JIS X 0201, JIS X 0208, and JIS X 0212
|
||||
* coded character sets for the Japanese language.
|
||||
*
|
||||
|
@ -495,14 +495,14 @@ public abstract class Charset
|
|||
* The name of the requested charset; may be either
|
||||
* a canonical name or an alias
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, support for the named charset
|
||||
* @return {@code true} if, and only if, support for the named charset
|
||||
* is available in the current Java virtual machine
|
||||
*
|
||||
* @throws IllegalCharsetNameException
|
||||
* If the given charset name is illegal
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the given <tt>charsetName</tt> is null
|
||||
* If the given {@code charsetName} is null
|
||||
*/
|
||||
public static boolean isSupported(String charsetName) {
|
||||
return (lookup(charsetName) != null);
|
||||
|
@ -521,7 +521,7 @@ public abstract class Charset
|
|||
* If the given charset name is illegal
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the given <tt>charsetName</tt> is null
|
||||
* If the given {@code charsetName} is null
|
||||
*
|
||||
* @throws UnsupportedCharsetException
|
||||
* If no support for the named charset is available
|
||||
|
@ -692,7 +692,7 @@ public abstract class Charset
|
|||
* href="http://www.iana.org/assignments/character-sets">IANA Charset
|
||||
* Registry</a>.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this charset is known by its
|
||||
* @return {@code true} if, and only if, this charset is known by its
|
||||
* implementor to be registered with the IANA
|
||||
*/
|
||||
public final boolean isRegistered() {
|
||||
|
@ -732,15 +732,15 @@ public abstract class Charset
|
|||
* <p> Every charset contains itself.
|
||||
*
|
||||
* <p> This method computes an approximation of the containment relation:
|
||||
* If it returns <tt>true</tt> then the given charset is known to be
|
||||
* contained by this charset; if it returns <tt>false</tt>, however, then
|
||||
* If it returns {@code true} then the given charset is known to be
|
||||
* contained by this charset; if it returns {@code false}, however, then
|
||||
* it is not necessarily the case that the given charset is not contained
|
||||
* in this charset.
|
||||
*
|
||||
* @param cs
|
||||
* The given charset
|
||||
*
|
||||
* @return <tt>true</tt> if the given charset is contained in this charset
|
||||
* @return {@code true} if the given charset is contained in this charset
|
||||
*/
|
||||
public abstract boolean contains(Charset cs);
|
||||
|
||||
|
@ -770,9 +770,9 @@ public abstract class Charset
|
|||
* input byte sequence. Such charsets do not support encoding because
|
||||
* there is no way to determine which encoding should be used on output.
|
||||
* Implementations of such charsets should override this method to return
|
||||
* <tt>false</tt>. </p>
|
||||
* {@code false}. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this charset supports encoding
|
||||
* @return {@code true} if, and only if, this charset supports encoding
|
||||
*/
|
||||
public boolean canEncode() {
|
||||
return true;
|
||||
|
@ -782,7 +782,7 @@ public abstract class Charset
|
|||
* Convenience method that decodes bytes in this charset into Unicode
|
||||
* characters.
|
||||
*
|
||||
* <p> An invocation of this method upon a charset <tt>cs</tt> returns the
|
||||
* <p> An invocation of this method upon a charset {@code cs} returns the
|
||||
* same result as the expression
|
||||
*
|
||||
* <pre>
|
||||
|
@ -818,7 +818,7 @@ public abstract class Charset
|
|||
* Convenience method that encodes Unicode characters into bytes in this
|
||||
* charset.
|
||||
*
|
||||
* <p> An invocation of this method upon a charset <tt>cs</tt> returns the
|
||||
* <p> An invocation of this method upon a charset {@code cs} returns the
|
||||
* same result as the expression
|
||||
*
|
||||
* <pre>
|
||||
|
@ -853,7 +853,7 @@ public abstract class Charset
|
|||
/**
|
||||
* Convenience method that encodes a string into bytes in this charset.
|
||||
*
|
||||
* <p> An invocation of this method upon a charset <tt>cs</tt> returns the
|
||||
* <p> An invocation of this method upon a charset {@code cs} returns the
|
||||
* same result as the expression
|
||||
*
|
||||
* <pre>
|
||||
|
@ -898,7 +898,7 @@ public abstract class Charset
|
|||
* <p> Two charsets are equal if, and only if, they have the same canonical
|
||||
* names. A charset is never equal to any other type of object. </p>
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this charset is equal to the
|
||||
* @return {@code true} if, and only if, this charset is equal to the
|
||||
* given object
|
||||
*/
|
||||
public final boolean equals(Object ob) {
|
||||
|
|
|
@ -46,24 +46,24 @@ import java.util.HashMap;
|
|||
* processed, or there is insufficient input and additional input is
|
||||
* required. This condition is represented by the unique result object
|
||||
* {@link #UNDERFLOW}, whose {@link #isUnderflow() isUnderflow} method
|
||||
* returns <tt>true</tt>. </p></li>
|
||||
* returns {@code true}. </p></li>
|
||||
*
|
||||
* <li><p> <i>Overflow</i> is reported when there is insufficient room
|
||||
* remaining in the output buffer. This condition is represented by the
|
||||
* unique result object {@link #OVERFLOW}, whose {@link #isOverflow()
|
||||
* isOverflow} method returns <tt>true</tt>. </p></li>
|
||||
* isOverflow} method returns {@code true}. </p></li>
|
||||
*
|
||||
* <li><p> A <i>malformed-input error</i> is reported when a sequence of
|
||||
* input units is not well-formed. Such errors are described by instances of
|
||||
* this class whose {@link #isMalformed() isMalformed} method returns
|
||||
* <tt>true</tt> and whose {@link #length() length} method returns the length
|
||||
* {@code true} and whose {@link #length() length} method returns the length
|
||||
* of the malformed sequence. There is one unique instance of this class for
|
||||
* all malformed-input errors of a given length. </p></li>
|
||||
*
|
||||
* <li><p> An <i>unmappable-character error</i> is reported when a sequence
|
||||
* of input units denotes a character that cannot be represented in the
|
||||
* output charset. Such errors are described by instances of this class
|
||||
* whose {@link #isUnmappable() isUnmappable} method returns <tt>true</tt> and
|
||||
* whose {@link #isUnmappable() isUnmappable} method returns {@code true} and
|
||||
* whose {@link #length() length} method returns the length of the input
|
||||
* sequence denoting the unmappable character. There is one unique instance
|
||||
* of this class for all unmappable-character errors of a given length.
|
||||
|
@ -71,9 +71,9 @@ import java.util.HashMap;
|
|||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p> For convenience, the {@link #isError() isError} method returns <tt>true</tt>
|
||||
* <p> For convenience, the {@link #isError() isError} method returns {@code true}
|
||||
* for result objects that describe malformed-input and unmappable-character
|
||||
* errors but <tt>false</tt> for those that describe underflow or overflow
|
||||
* errors but {@code false} for those that describe underflow or overflow
|
||||
* conditions. </p>
|
||||
*
|
||||
*
|
||||
|
@ -114,7 +114,7 @@ public class CoderResult {
|
|||
/**
|
||||
* Tells whether or not this object describes an underflow condition.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this object denotes underflow
|
||||
* @return {@code true} if, and only if, this object denotes underflow
|
||||
*/
|
||||
public boolean isUnderflow() {
|
||||
return (type == CR_UNDERFLOW);
|
||||
|
@ -123,7 +123,7 @@ public class CoderResult {
|
|||
/**
|
||||
* Tells whether or not this object describes an overflow condition.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this object denotes overflow
|
||||
* @return {@code true} if, and only if, this object denotes overflow
|
||||
*/
|
||||
public boolean isOverflow() {
|
||||
return (type == CR_OVERFLOW);
|
||||
|
@ -132,7 +132,7 @@ public class CoderResult {
|
|||
/**
|
||||
* Tells whether or not this object describes an error condition.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this object denotes either a
|
||||
* @return {@code true} if, and only if, this object denotes either a
|
||||
* malformed-input error or an unmappable-character error
|
||||
*/
|
||||
public boolean isError() {
|
||||
|
@ -142,7 +142,7 @@ public class CoderResult {
|
|||
/**
|
||||
* Tells whether or not this object describes a malformed-input error.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this object denotes a
|
||||
* @return {@code true} if, and only if, this object denotes a
|
||||
* malformed-input error
|
||||
*/
|
||||
public boolean isMalformed() {
|
||||
|
@ -153,7 +153,7 @@ public class CoderResult {
|
|||
* Tells whether or not this object describes an unmappable-character
|
||||
* error.
|
||||
*
|
||||
* @return <tt>true</tt> if, and only if, this object denotes an
|
||||
* @return {@code true} if, and only if, this object denotes an
|
||||
* unmappable-character error
|
||||
*/
|
||||
public boolean isUnmappable() {
|
||||
|
@ -168,7 +168,7 @@ public class CoderResult {
|
|||
*
|
||||
* @throws UnsupportedOperationException
|
||||
* If this object does not describe an error condition, that is,
|
||||
* if the {@link #isError() isError} does not return <tt>true</tt>
|
||||
* if the {@link #isError() isError} does not return {@code true}
|
||||
*/
|
||||
public int length() {
|
||||
if (!isError())
|
||||
|
|
|
@ -74,10 +74,10 @@
|
|||
*
|
||||
* <p> Support for new charsets can be made available via the
|
||||
* interface defined in the {@link
|
||||
* java.nio.charset.spi.CharsetProvider} class in the <tt>{@link
|
||||
* java.nio.charset.spi}</tt> package.
|
||||
* java.nio.charset.spi.CharsetProvider} class in the {@link
|
||||
* java.nio.charset.spi} package.
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
|
||||
* <p> Unless otherwise noted, passing a {@code null} argument to a
|
||||
* constructor or method in any class or interface in this package
|
||||
* will cause a {@link java.lang.NullPointerException
|
||||
* NullPointerException} to be thrown.
|
||||
|
|
|
@ -42,13 +42,13 @@ import java.util.Iterator;
|
|||
* loader}.
|
||||
*
|
||||
* <p> A charset provider identifies itself with a provider-configuration file
|
||||
* named <tt>java.nio.charset.spi.CharsetProvider</tt> in the resource
|
||||
* directory <tt>META-INF/services</tt>. The file should contain a list of
|
||||
* named {@code java.nio.charset.spi.CharsetProvider} in the resource
|
||||
* directory {@code META-INF/services}. The file should contain a list of
|
||||
* fully-qualified concrete charset-provider class names, one per line. A line
|
||||
* is terminated by any one of a line feed (<tt>'\n'</tt>), a carriage return
|
||||
* (<tt>'\r'</tt>), or a carriage return followed immediately by a line feed.
|
||||
* is terminated by any one of a line feed ({@code '\n'}), a carriage return
|
||||
* ({@code '\r'}), or a carriage return followed immediately by a line feed.
|
||||
* Space and tab characters surrounding each name, as well as blank lines, are
|
||||
* ignored. The comment character is <tt>'#'</tt> (<tt>'\u0023'</tt>); on
|
||||
* ignored. The comment character is {@code '#'} (<code>'\u0023'</code>); on
|
||||
* each line all characters following the first comment character are ignored.
|
||||
* The file must be encoded in UTF-8.
|
||||
*
|
||||
|
@ -83,7 +83,7 @@ public abstract class CharsetProvider {
|
|||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed and it denies
|
||||
* {@link RuntimePermission}<tt>("charsetProvider")</tt>
|
||||
* {@link RuntimePermission}{@code ("charsetProvider")}
|
||||
*/
|
||||
protected CharsetProvider() {
|
||||
this(checkPermission());
|
||||
|
@ -107,7 +107,7 @@ public abstract class CharsetProvider {
|
|||
* a canonical name or an alias
|
||||
*
|
||||
* @return A charset object for the named charset,
|
||||
* or <tt>null</tt> if the named charset
|
||||
* or {@code null} if the named charset
|
||||
* is not supported by this provider
|
||||
*/
|
||||
public abstract Charset charsetForName(String charsetName);
|
||||
|
|
|
@ -56,5 +56,5 @@ SUPER=UnsupportedOperationException
|
|||
|
||||
gen ReadOnlyBufferException "
|
||||
* Unchecked exception thrown when a content-mutation method such as
|
||||
* <tt>put</tt> or <tt>compact</tt> is invoked upon a read-only buffer." \
|
||||
* <code>put</code> or <code>compact</code> is invoked upon a read-only buffer." \
|
||||
-1210063976496234090L
|
||||
|
|
|
@ -202,7 +202,7 @@ public abstract class FileSystem
|
|||
*
|
||||
* <p> In the case of the default provider, and a security manager is
|
||||
* installed, the security manager is invoked to check {@link
|
||||
* RuntimePermission}<tt>("getFileStoreAttributes")</tt>. If denied, then
|
||||
* RuntimePermission}{@code ("getFileStoreAttributes")}. If denied, then
|
||||
* no file stores are returned by the iterator. In addition, the security
|
||||
* manager's {@link SecurityManager#checkRead(String)} method is invoked to
|
||||
* check read access to the file store's <em>top-most</em> directory. If
|
||||
|
@ -334,19 +334,19 @@ public abstract class FileSystem
|
|||
* character extension</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>/home/*/*</tt>
|
||||
* <td>Matches <tt>/home/gus/data</tt> on UNIX platforms</td>
|
||||
* <td><code>/home/*/*</code>
|
||||
* <td>Matches <code>/home/gus/data</code> on UNIX platforms</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>/home/**</tt>
|
||||
* <td>Matches <tt>/home/gus</tt> and
|
||||
* <tt>/home/gus/data</tt> on UNIX platforms</td>
|
||||
* <td><code>/home/**</code>
|
||||
* <td>Matches <code>/home/gus</code> and
|
||||
* <code>/home/gus/data</code> on UNIX platforms</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>C:\\*</tt>
|
||||
* <td>Matches <tt>C:\foo</tt> and <tt>C:\bar</tt> on the Windows
|
||||
* <td><code>C:\\*</code>
|
||||
* <td>Matches <code>C:\foo</code> and <code>C:\bar</code> on the Windows
|
||||
* platform (note that the backslash is escaped; as a string literal in the
|
||||
* Java Language the pattern would be <tt>"C:\\\\*"</tt>) </td>
|
||||
* Java Language the pattern would be <code>"C:\\\\*"</code>) </td>
|
||||
* </tr>
|
||||
*
|
||||
* </table>
|
||||
|
@ -390,7 +390,7 @@ public abstract class FileSystem
|
|||
* character is used to separate the subpatterns. Groups cannot be nested.
|
||||
* </p></li>
|
||||
*
|
||||
* <li><p> Leading period<tt>/</tt>dot characters in file name are
|
||||
* <li><p> Leading period<code>/</code>dot characters in file name are
|
||||
* treated as regular characters in match operations. For example,
|
||||
* the {@code "*"} glob pattern matches file name {@code ".login"}.
|
||||
* The {@link Files#isHidden} method may be used to test whether a file
|
||||
|
|
|
@ -1033,7 +1033,7 @@ public final class Files {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager
|
||||
* is installed, it denies {@link LinkPermission}<tt>("symbolic")</tt>
|
||||
* is installed, it denies {@link LinkPermission}{@code ("symbolic")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the path of the symbolic link.
|
||||
*/
|
||||
|
@ -1078,7 +1078,7 @@ public final class Files {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager
|
||||
* is installed, it denies {@link LinkPermission}<tt>("hard")</tt>
|
||||
* is installed, it denies {@link LinkPermission}{@code ("hard")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to either the link or the
|
||||
* existing file.
|
||||
|
@ -1455,8 +1455,8 @@ public final class Files {
|
|||
* In the case of the default provider, and a security manager is
|
||||
* installed, the {@link SecurityManager#checkRead(String) checkRead}
|
||||
* method is invoked to check read access to the file, and in
|
||||
* addition it checks {@link RuntimePermission}<tt>
|
||||
* ("getFileStoreAttributes")</tt>
|
||||
* addition it checks
|
||||
* {@link RuntimePermission}{@code ("getFileStoreAttributes")}
|
||||
*/
|
||||
public static FileStore getFileStore(Path path) throws IOException {
|
||||
return provider(path).getFileStore(path);
|
||||
|
@ -1995,7 +1995,8 @@ public final class Files {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, and it denies
|
||||
* {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*/
|
||||
|
@ -2032,7 +2033,8 @@ public final class Files {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager is
|
||||
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, it denies
|
||||
* {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the file.
|
||||
*/
|
||||
|
@ -2069,7 +2071,8 @@ public final class Files {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager is
|
||||
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, it denies
|
||||
* {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*/
|
||||
|
@ -2112,7 +2115,8 @@ public final class Files {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager is
|
||||
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, it denies
|
||||
* {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the file.
|
||||
*
|
||||
|
|
|
@ -46,13 +46,13 @@ public class InvalidPathException
|
|||
* @param input the input string
|
||||
* @param reason a string explaining why the input was rejected
|
||||
* @param index the index at which the error occurred,
|
||||
* or <tt>-1</tt> if the index is not known
|
||||
* or {@code -1} if the index is not known
|
||||
*
|
||||
* @throws NullPointerException
|
||||
* if either the input or reason strings are <tt>null</tt>
|
||||
* if either the input or reason strings are {@code null}
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if the error index is less than <tt>-1</tt>
|
||||
* if the error index is less than {@code -1}
|
||||
*/
|
||||
public InvalidPathException(String input, String reason, int index) {
|
||||
super(reason);
|
||||
|
@ -66,13 +66,13 @@ public class InvalidPathException
|
|||
|
||||
/**
|
||||
* Constructs an instance from the given input string and reason. The
|
||||
* resulting object will have an error index of <tt>-1</tt>.
|
||||
* resulting object will have an error index of {@code -1}.
|
||||
*
|
||||
* @param input the input string
|
||||
* @param reason a string explaining why the input was rejected
|
||||
*
|
||||
* @throws NullPointerException
|
||||
* if either the input or reason strings are <tt>null</tt>
|
||||
* if either the input or reason strings are {@code null}
|
||||
*/
|
||||
public InvalidPathException(String input, String reason) {
|
||||
this(input, reason, -1);
|
||||
|
@ -98,7 +98,7 @@ public class InvalidPathException
|
|||
|
||||
/**
|
||||
* Returns an index into the input string of the position at which the
|
||||
* error occurred, or <tt>-1</tt> if this position is not known.
|
||||
* error occurred, or {@code -1} if this position is not known.
|
||||
*
|
||||
* @return the error index
|
||||
*/
|
||||
|
@ -109,8 +109,8 @@ public class InvalidPathException
|
|||
/**
|
||||
* Returns a string describing the error. The resulting string
|
||||
* consists of the reason string followed by a colon character
|
||||
* (<tt>':'</tt>), a space, and the input string. If the error index is
|
||||
* defined then the string <tt>" at index "</tt> followed by the index, in
|
||||
* ({@code ':'}), a space, and the input string. If the error index is
|
||||
* defined then the string {@code " at index "} followed by the index, in
|
||||
* decimal, is inserted after the reason string and before the colon
|
||||
* character.
|
||||
*
|
||||
|
|
|
@ -480,7 +480,8 @@ public interface Path
|
|||
* <p> For any two {@link #normalize normalized} paths <i>p</i> and
|
||||
* <i>q</i>, where <i>q</i> does not have a root component,
|
||||
* <blockquote>
|
||||
* <i>p</i><tt>.relativize(</tt><i>p</i><tt>.resolve(</tt><i>q</i><tt>)).equals(</tt><i>q</i><tt>)</tt>
|
||||
* <i>p</i>{@code .relativize(}<i>p</i>
|
||||
* {@code .resolve(}<i>q</i>{@code )).equals(}<i>q</i>{@code )}
|
||||
* </blockquote>
|
||||
*
|
||||
* <p> When symbolic links are supported, then whether the resulting path,
|
||||
|
@ -525,9 +526,9 @@ public interface Path
|
|||
* <p> The default provider provides a similar <em>round-trip</em> guarantee
|
||||
* to the {@link java.io.File} class. For a given {@code Path} <i>p</i> it
|
||||
* is guaranteed that
|
||||
* <blockquote><tt>
|
||||
* {@link Paths#get(URI) Paths.get}(</tt><i>p</i><tt>.toUri()).equals(</tt><i>p</i>
|
||||
* <tt>.{@link #toAbsolutePath() toAbsolutePath}())</tt>
|
||||
* <blockquote>
|
||||
* {@link Paths#get(URI) Paths.get}{@code (}<i>p</i>{@code .toUri()).equals(}<i>p</i>
|
||||
* {@code .}{@link #toAbsolutePath() toAbsolutePath}{@code ())}
|
||||
* </blockquote>
|
||||
* so long as the original {@code Path}, the {@code URI}, and the new {@code
|
||||
* Path} are all created in (possibly different invocations of) the same
|
||||
|
|
|
@ -103,9 +103,9 @@ public final class Paths {
|
|||
* <p> The default provider provides a similar <em>round-trip</em> guarantee
|
||||
* to the {@link java.io.File} class. For a given {@code Path} <i>p</i> it
|
||||
* is guaranteed that
|
||||
* <blockquote><tt>
|
||||
* Paths.get(</tt><i>p</i><tt>.{@link Path#toUri() toUri}()).equals(</tt>
|
||||
* <i>p</i><tt>.{@link Path#toAbsolutePath() toAbsolutePath}())</tt>
|
||||
* <blockquote>{@code
|
||||
* Paths.get(}<i>p</i>{@code .}{@link Path#toUri() toUri}{@code ()).equals(}
|
||||
* <i>p</i>{@code .}{@link Path#toAbsolutePath() toAbsolutePath}{@code ())}
|
||||
* </blockquote>
|
||||
* so long as the original {@code Path}, the {@code URI}, and the new {@code
|
||||
* Path} are all created in (possibly different invocations of) the same
|
||||
|
|
|
@ -165,7 +165,7 @@ public interface AclFileAttributeView
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, and it denies {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*/
|
||||
|
@ -201,7 +201,7 @@ public interface AclFileAttributeView
|
|||
* if an I/O error occurs or the ACL is invalid
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, it denies {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the file.
|
||||
*/
|
||||
|
|
|
@ -69,7 +69,7 @@ public interface FileOwnerAttributeView
|
|||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link
|
||||
* RuntimePermission}<tt>("accessUserInformation")</tt> or its
|
||||
* RuntimePermission}{@code ("accessUserInformation")} or its
|
||||
* {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*/
|
||||
|
@ -93,7 +93,7 @@ public interface FileOwnerAttributeView
|
|||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link
|
||||
* RuntimePermission}<tt>("accessUserInformation")</tt> or its
|
||||
* RuntimePermission}{@code ("accessUserInformation")} or its
|
||||
* {@link SecurityManager#checkWrite(String) checkWrite} method
|
||||
* denies write access to the file.
|
||||
*/
|
||||
|
|
|
@ -149,7 +149,8 @@ public interface PosixFileAttributeView
|
|||
* @throws IOException {@inheritDoc}
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, and it denies
|
||||
* {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*/
|
||||
|
@ -169,7 +170,8 @@ public interface PosixFileAttributeView
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, and it denies
|
||||
* {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the file.
|
||||
*/
|
||||
|
@ -185,7 +187,8 @@ public interface PosixFileAttributeView
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager is
|
||||
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
|
||||
* installed, it denies
|
||||
* {@link RuntimePermission}{@code ("accessUserInformation")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the file.
|
||||
*/
|
||||
|
|
|
@ -89,7 +89,7 @@ public interface UserDefinedFileAttributeView
|
|||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link
|
||||
* RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
|
||||
* RuntimePermission}{@code ("accessUserDefinedAttributes")}
|
||||
* or its {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*/
|
||||
|
@ -110,7 +110,7 @@ public interface UserDefinedFileAttributeView
|
|||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link
|
||||
* RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
|
||||
* RuntimePermission}{@code ("accessUserDefinedAttributes")}
|
||||
* or its {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*/
|
||||
|
@ -156,7 +156,7 @@ public interface UserDefinedFileAttributeView
|
|||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link
|
||||
* RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
|
||||
* RuntimePermission}{@code ("accessUserDefinedAttributes")}
|
||||
* or its {@link SecurityManager#checkRead(String) checkRead} method
|
||||
* denies read access to the file.
|
||||
*
|
||||
|
@ -206,7 +206,7 @@ public interface UserDefinedFileAttributeView
|
|||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link
|
||||
* RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
|
||||
* RuntimePermission}{@code ("accessUserDefinedAttributes")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the file.
|
||||
*/
|
||||
|
@ -223,7 +223,7 @@ public interface UserDefinedFileAttributeView
|
|||
* @throws SecurityException
|
||||
* In the case of the default provider, a security manager is
|
||||
* installed, and it denies {@link
|
||||
* RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
|
||||
* RuntimePermission}{@code ("accessUserDefinedAttributes")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the file.
|
||||
*/
|
||||
|
|
|
@ -72,7 +72,8 @@ public abstract class UserPrincipalLookupService {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager is
|
||||
* installed, it checks {@link RuntimePermission}<tt>("lookupUserInformation")</tt>
|
||||
* installed, it checks
|
||||
* {@link RuntimePermission}{@code ("lookupUserInformation")}
|
||||
*/
|
||||
public abstract UserPrincipal lookupPrincipalByName(String name)
|
||||
throws IOException;
|
||||
|
@ -97,7 +98,8 @@ public abstract class UserPrincipalLookupService {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager is
|
||||
* installed, it checks {@link RuntimePermission}<tt>("lookupUserInformation")</tt>
|
||||
* installed, it checks
|
||||
* {@link RuntimePermission}{@code ("lookupUserInformation")}
|
||||
*/
|
||||
public abstract GroupPrincipal lookupPrincipalByGroupName(String group)
|
||||
throws IOException;
|
||||
|
|
|
@ -54,7 +54,7 @@ public class UserPrincipalNotFoundException
|
|||
|
||||
/**
|
||||
* Returns the user principal name if this exception was created with the
|
||||
* user principal name that was not found, otherwise <tt>null</tt>.
|
||||
* user principal name that was not found, otherwise {@code null}.
|
||||
*
|
||||
* @return the user principal name or {@code null}
|
||||
*/
|
||||
|
|
|
@ -28,23 +28,23 @@
|
|||
*
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Attribute views">
|
||||
* <tr><th align="left">Attribute views</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top><tt><i>{@link java.nio.file.attribute.AttributeView}</i></tt></td>
|
||||
* <tr><td valign=top><i>{@link java.nio.file.attribute.AttributeView}</i></td>
|
||||
* <td>Can read or update non-opaque values associated with objects in a file system</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.FileAttributeView}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.FileAttributeView}</i></td>
|
||||
* <td>Can read or update file attributes</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.BasicFileAttributeView} </i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.BasicFileAttributeView} </i></td>
|
||||
* <td>Can read or update a basic set of file attributes</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.PosixFileAttributeView} </i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.PosixFileAttributeView} </i></td>
|
||||
* <td>Can read or update POSIX defined file attributes</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.DosFileAttributeView} </i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.DosFileAttributeView} </i></td>
|
||||
* <td>Can read or update FAT file attributes</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.FileOwnerAttributeView} </i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.FileOwnerAttributeView} </i></td>
|
||||
* <td>Can read or update the owner of a file</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.AclFileAttributeView} </i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.AclFileAttributeView} </i></td>
|
||||
* <td>Can read or update Access Control Lists</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.UserDefinedFileAttributeView} </i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.UserDefinedFileAttributeView} </i></td>
|
||||
* <td>Can read or update user-defined file attributes</td></tr>
|
||||
* <tr><td valign=top><tt> <i>{@link java.nio.file.attribute.FileStoreAttributeView}</i></tt></td>
|
||||
* <tr><td valign=top> <i>{@link java.nio.file.attribute.FileStoreAttributeView}</i></td>
|
||||
* <td>Can read or update file system attributes</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
|
@ -100,7 +100,7 @@
|
|||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
|
||||
* <p> Unless otherwise noted, passing a {@code null} argument to a constructor
|
||||
* or method in any class or interface in this package will cause a {@link
|
||||
* java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
*
|
||||
|
|
|
@ -102,7 +102,7 @@ public abstract class FileSystemProvider {
|
|||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed and it denies
|
||||
* {@link RuntimePermission}<tt>("fileSystemProvider")</tt>
|
||||
* {@link RuntimePermission}{@code ("fileSystemProvider")}
|
||||
*/
|
||||
protected FileSystemProvider() {
|
||||
this(checkPermission());
|
||||
|
@ -644,7 +644,7 @@ public abstract class FileSystemProvider {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager
|
||||
* is installed, it denies {@link LinkPermission}<tt>("symbolic")</tt>
|
||||
* is installed, it denies {@link LinkPermission}{@code ("symbolic")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to the path of the symbolic link.
|
||||
*/
|
||||
|
@ -677,7 +677,7 @@ public abstract class FileSystemProvider {
|
|||
* if an I/O error occurs
|
||||
* @throws SecurityException
|
||||
* In the case of the default provider, and a security manager
|
||||
* is installed, it denies {@link LinkPermission}<tt>("hard")</tt>
|
||||
* is installed, it denies {@link LinkPermission}{@code ("hard")}
|
||||
* or its {@link SecurityManager#checkWrite(String) checkWrite}
|
||||
* method denies write access to either the link or the
|
||||
* existing file.
|
||||
|
@ -902,8 +902,8 @@ public abstract class FileSystemProvider {
|
|||
* In the case of the default provider, and a security manager is
|
||||
* installed, the {@link SecurityManager#checkRead(String) checkRead}
|
||||
* method is invoked to check read access to the file, and in
|
||||
* addition it checks {@link RuntimePermission}<tt>
|
||||
* ("getFileStoreAttributes")</tt>
|
||||
* addition it checks
|
||||
* {@link RuntimePermission}{@code ("getFileStoreAttributes")}
|
||||
*/
|
||||
public abstract FileStore getFileStore(Path path) throws IOException;
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public abstract class FileTypeDetector {
|
|||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed and it denies
|
||||
* {@link RuntimePermission}<tt>("fileTypeDetector")</tt>
|
||||
* {@link RuntimePermission}{@code ("fileTypeDetector")}
|
||||
*/
|
||||
protected FileTypeDetector() {
|
||||
this(checkPermission());
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Service-provider classes for the <tt>{@link java.nio.file}</tt> package.
|
||||
* Service-provider classes for the {@link java.nio.file} package.
|
||||
*
|
||||
* <p> Only developers who are defining new file system providers or file type
|
||||
* detectors should need to make direct use of this package. </p>
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
|
||||
* <p> Unless otherwise noted, passing a {@code null} argument to a constructor
|
||||
* or method in any class or interface in this package will cause a {@link
|
||||
* java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
*
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p> The <tt>java.nio</tt> package defines the buffer classes, which
|
||||
* <p> The {@code java.nio} package defines the buffer classes, which
|
||||
* are used throughout the NIO APIs. The charset API is defined in
|
||||
* the {@link java.nio.charset} package, and the channel and selector
|
||||
* APIs are defined in the {@link java.nio.channels} package. Each of
|
||||
|
@ -64,26 +64,26 @@
|
|||
*
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Description of the various buffers">
|
||||
* <tr><th align="left">Buffers</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.Buffer}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.Buffer}</td>
|
||||
* <td>Position, limit, and capacity;
|
||||
* <br>clear, flip, rewind, and mark/reset</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.ByteBuffer}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.ByteBuffer}</td>
|
||||
* <td>Get/put, compact, views; allocate, wrap</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.MappedByteBuffer} </tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.MappedByteBuffer} </td>
|
||||
* <td>A byte buffer mapped to a file</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.CharBuffer}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.CharBuffer}</td>
|
||||
* <td>Get/put, compact; allocate, wrap</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.DoubleBuffer}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.DoubleBuffer}</td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.FloatBuffer}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.FloatBuffer}</td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.IntBuffer}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.IntBuffer}</td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.LongBuffer}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.LongBuffer}</td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.ShortBuffer}</tt></td>
|
||||
* <tr><td valign=top> {@link java.nio.ShortBuffer}</td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.ByteOrder}</tt></td>
|
||||
* <tr><td valign=top>{@link java.nio.ByteOrder}</td>
|
||||
* <td>Typesafe enumeration for byte orders</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
|
@ -129,7 +129,7 @@
|
|||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
|
||||
* <p> Unless otherwise noted, passing a {@code null} argument to a
|
||||
* constructor or method in any class or interface in this package
|
||||
* will cause a {@link java.lang.NullPointerException
|
||||
* NullPointerException} to be thrown.
|
||||
|
|
|
@ -29,11 +29,11 @@ import java.nio.ByteBuffer;
|
|||
import java.io.IOException;
|
||||
|
||||
/** This is an interface to adapt existing APIs to use {@link java.nio.ByteBuffer
|
||||
* <tt>ByteBuffers</tt>} as the underlying
|
||||
* ByteBuffers} as the underlying
|
||||
* data format. Only the initial producer and final consumer have to be changed.<p>
|
||||
*
|
||||
* For example, the Zip/Jar code supports {@link java.io.InputStream <tt>InputStreams</tt>}.
|
||||
* To make the Zip code use {@link java.nio.MappedByteBuffer <tt>MappedByteBuffers</tt>} as
|
||||
* For example, the Zip/Jar code supports {@link java.io.InputStream InputStreams}.
|
||||
* To make the Zip code use {@link java.nio.MappedByteBuffer MappedByteBuffers} as
|
||||
* the underlying data structure, it can create a class of InputStream that wraps the ByteBuffer,
|
||||
* and implements the ByteBuffered interface. A co-operating class several layers
|
||||
* away can ask the InputStream if it is an instance of ByteBuffered, then
|
||||
|
@ -42,12 +42,12 @@ import java.io.IOException;
|
|||
public interface ByteBuffered {
|
||||
|
||||
/**
|
||||
* Returns the <tt>ByteBuffer</tt> behind this object, if this particular
|
||||
* instance has one. An implementation of <tt>getByteBuffer()</tt> is allowed
|
||||
* to return <tt>null</tt> for any reason.
|
||||
* Returns the {@code ByteBuffer} behind this object, if this particular
|
||||
* instance has one. An implementation of {@code getByteBuffer()} is allowed
|
||||
* to return {@code null} for any reason.
|
||||
*
|
||||
* @return The <tt>ByteBuffer</tt>, if this particular instance has one,
|
||||
* or <tt>null</tt> otherwise.
|
||||
* @return The {@code ByteBuffer}, if this particular instance has one,
|
||||
* or {@code null} otherwise.
|
||||
*
|
||||
* @throws IOException
|
||||
* If the ByteBuffer is no longer valid.
|
||||
|
|
|
@ -36,14 +36,14 @@ class AllocatedNativeObject // package-private
|
|||
{
|
||||
|
||||
/**
|
||||
* Allocates a memory area of at least <tt>size</tt> bytes outside of the
|
||||
* Allocates a memory area of at least {@code size} bytes outside of the
|
||||
* Java heap and creates a native object for that area.
|
||||
*
|
||||
* @param size
|
||||
* Number of bytes to allocate
|
||||
*
|
||||
* @param pageAligned
|
||||
* If <tt>true</tt> then the area will be aligned on a hardware
|
||||
* If {@code true} then the area will be aligned on a hardware
|
||||
* page boundary
|
||||
*
|
||||
* @throws OutOfMemoryError
|
||||
|
|
|
@ -538,11 +538,11 @@ public abstract class SctpChannel
|
|||
* {@link java.io.IOException} to be thrown.
|
||||
*
|
||||
* <P> If this channel is already connected then this method will not block
|
||||
* and will immediately return <tt>true</tt>. If this channel is in
|
||||
* non-blocking mode then this method will return <tt>false</tt> if the
|
||||
* and will immediately return {@code true}. If this channel is in
|
||||
* non-blocking mode then this method will return {@code false} if the
|
||||
* connection process is not yet complete. If this channel is in blocking
|
||||
* mode then this method will block until the connection either completes
|
||||
* or fails, and will always either return <tt>true</tt> or throw a checked
|
||||
* or fails, and will always either return {@code true} or throw a checked
|
||||
* exception describing the failure.
|
||||
*
|
||||
* <P> This method may be invoked at any time. If a {@link #send send} or {@link #receive receive}
|
||||
|
@ -711,9 +711,9 @@ public abstract class SctpChannel
|
|||
* Returns an operation set identifying this channel's supported operations.
|
||||
*
|
||||
* <P> SCTP channels support connecting, reading, and writing, so this
|
||||
* method returns <tt>(</tt>{@link SelectionKey#OP_CONNECT}
|
||||
* <tt>|</tt> {@link SelectionKey#OP_READ} <tt>|</tt> {@link
|
||||
* SelectionKey#OP_WRITE}<tt>)</tt>. </p>
|
||||
* method returns {@code (}{@link SelectionKey#OP_CONNECT}
|
||||
* {@code |} {@link SelectionKey#OP_READ} {@code |} {@link
|
||||
* SelectionKey#OP_WRITE}{@code )}.
|
||||
*
|
||||
* @return The valid-operation set
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue