scjd certification needs an alternative approach for Deprecated methods. Help needed ????
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Res_Singh
Posted On:   Saturday, January 26, 2002 05:30 PM

Following methods from java.lang.String has been deprecated. Can someone help in finding a alternate solutions for them.


1. getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin)



2. String(byte[] ascii, int hibyte, int offset, int count)



Thanks


ruks09@yahoo.com

Re: scjd certification needs an alternative approach for Deprecated methods. Help needed ????

Posted By:   Anonymous  
Posted On:   Friday, February 22, 2002 04:31 AM

I substituted:

newData[i].getBytes(0, toCopy, buffer, offset);
with

entryBuffer = newData[i].getBytes("UTF-8");

//copying entry into the buffer containing the record

System.arraycopy(entryBuffer, 0,buffer, offset,entryBuffer.length);

and

rv[i] = new String(buffer, 0, offset, description[i].getLength());
with

rv[i] = new String(buffer, offset, description[i].getLength(),"UTF-8");
About | Sitemap | Contact