ticket:10944: Add ByteBuffer support for StringPrep.
Also adds the ICUBinary.getVersionByteArrayFromCompactInt() function.
R=markus.icu@gmail.com
Committed: http://bugs.icu-project.org/trac/changeset/36037
10 years, 5 months ago
(2014-07-14 15:04:33 UTC)
#3
https://codereview.appspot.com/106580043/diff/60001/main/classes/core/src/com...
File main/classes/core/src/com/ibm/icu/impl/StringPrepDataReader.java (right):
https://codereview.appspot.com/106580043/diff/60001/main/classes/core/src/com...
main/classes/core/src/com/ibm/icu/impl/StringPrepDataReader.java:32: * @param
bytes ICU uprop.dat file buffer
On 2014/07/11 18:37:11, markus.icu wrote:
> ICU StringPrep data file buffer
Done.
https://codereview.appspot.com/106580043/diff/60001/main/classes/core/src/com...
main/classes/core/src/com/ibm/icu/impl/StringPrepDataReader.java:78:
(byte)unicodeVersion.getMajor(),
On 2014/07/11 18:37:11, markus.icu wrote:
> It might be a little better to store the unicodeVersion as an int and just
turn
> it into a byte array here. You could create a method in ICUBinary for that,
> similar to the
> VersionInfo getVersionInfoFromCompactInt(int version)
> that's already there.
> For example,
> byte[] getVersionByteArrayFromCompactInt(int version)
Done.
https://codereview.appspot.com/106580043/diff/60001/main/classes/core/src/com...
File main/classes/core/src/com/ibm/icu/text/StringPrep.java (right):
https://codereview.appspot.com/106580043/diff/60001/main/classes/core/src/com...
main/classes/core/src/com/ibm/icu/text/StringPrep.java:285: public
StringPrep(ByteBuffer bytes) throws IOException{
On 2014/07/11 18:37:11, markus.icu wrote:
> Don't just add public API without proposal, see my longer comment in another
> review. For now, please just move this code into the existing constructor.
> Again, you could add a TODO for adding a ByteBuffer overload.
Done.
https://codereview.appspot.com/106580043/diff/60001/main/tests/core/src/com/i...
File main/tests/core/src/com/ibm/icu/dev/test/stringprep/NFS4StringPrep.java
(right):
https://codereview.appspot.com/106580043/diff/60001/main/tests/core/src/com/i...
main/tests/core/src/com/ibm/icu/dev/test/stringprep/NFS4StringPrep.java:42:
nfscsiFile.close();
On 2014/07/11 18:37:11, markus.icu wrote:
> Please move the declarations of all of these streams to before the "try", and
> add a "finally" where all of them are closed.
Instead, I reverted all changes to this file, as they only are relevant when
adding a StringPrep constructor taking ByteBuffer.
Issue 106580043: ticket:10944: Add ByteBuffer support for StringPrep.
(Closed)
Created 10 years, 5 months ago by roubert (google)
Modified 10 years, 5 months ago
Reviewers: markus.icu
Base URL: svn+ssh://source.icu-project.org/repos/icu/icu4j/trunk
Comments: 14