2003-05-19 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/ByteBufferImpl.java (putLong): Fixed conversion to bytes. (putDouble): Fixed conversion to bytes. * gnu/java/nio/DirectByteBufferImpl.java (putLong): Fixed conversion to bytes. (putDouble): Fixed conversion to bytes. * gnu/java/nio/FileLockImpl.java (isValid): Reformatted. * java/nio/Buffer.java (Buffer): Fixed off-by-one bug in handling mark. * java/nio/ByteBuffer.java: Added newline. * java/nio/CharBuffer.java (toString): Don't use relative get to get string data. From-SVN: r66946
This commit is contained in:
committed by
Michael Koch
parent
307b599c91
commit
10832fce7c
@@ -57,7 +57,7 @@ public abstract class Buffer
|
||||
limit (limit);
|
||||
position (position);
|
||||
|
||||
if (mark > 0)
|
||||
if (mark >= 0)
|
||||
{
|
||||
if (mark > pos)
|
||||
throw new IllegalArgumentException ();
|
||||
|
||||
@@ -63,6 +63,7 @@ public abstract class ByteBuffer extends Buffer
|
||||
this.backing_buffer = buffer;
|
||||
this.array_offset = offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates a new direct byte buffer.
|
||||
*/
|
||||
|
||||
@@ -113,7 +113,7 @@ public abstract class CharBuffer extends Buffer
|
||||
buffer [i] = a.charAt (i);
|
||||
}
|
||||
|
||||
return wrap (buffer, offset, length);
|
||||
return wrap (buffer, offset, length).asReadOnlyBuffer ();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -426,7 +426,7 @@ public abstract class CharBuffer extends Buffer
|
||||
return new String (array (), position (), length ());
|
||||
|
||||
char[] buf = new char [length ()];
|
||||
get (buf);
|
||||
get (position (), buf);
|
||||
return new String (buf);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user