natIconv.cc (done): New methods.

2001-07-30  Tom Tromey  <tromey@redhat.com>
	    Corey Minyard  <minyard@acm.org>

	* gnu/gcj/convert/natIconv.cc (done): New methods.
	* gnu/gcj/convert/Output_iconv.java (done): New method.
	* gnu/gcj/convert/Input_iconv.java (done): New method.
	* gnu/gcj/convert/UnicodeToBytes.java (defaultEncodingClass):
	Removed.
	(getDefaultEncodingClass): Removed.
	(getDefaultEncoder): Use getEncoder.
	(done): New method.
	(defaultEncoding, CACHE_SIZE, encoderCache, currCachePos): New
	static fields.
	* gnu/gcj/convert/BytesToUnicode.java (defaultDecodingClass):
	Removed.
	(defaultEncoding, CACHE_SIZE, decoderCache, currCachePos): New
	static fields.
	(getDefaultDecodingClass): Removed.
	(getDefaultDecoder): Use getDecoder.
	(getDecoder): Look up decoder in cache.
	(done): New method.
	* java/lang/natString.cc (init): Call `done' on converter.
	(getBytes): Likewise.

Co-Authored-By: Corey Minyard <minyard@acm.org>

From-SVN: r44484
This commit is contained in:
Tom Tromey 2001-07-30 20:24:18 +00:00 committed by Tom Tromey
parent a08b260482
commit 3d5aea8366
7 changed files with 207 additions and 69 deletions

View file

@ -523,6 +523,7 @@ java::lang::String::init (jbyteArray bytes, jint offset, jint count,
avail -= done;
}
}
converter->done ();
this->data = array;
this->boffset = (char *) elements (array) - (char *) array;
this->count = outpos;
@ -604,6 +605,7 @@ java::lang::String::getBytes (jstring enc)
todo -= converted;
}
}
converter->done ();
if (bufpos == buflen)
return buffer;
jbyteArray result = JvNewByteArray(bufpos);