Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is String.getBytes() efficient??

 
Terence Doyle
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is Objective 6.2:
Develop code that correctly implements adding, retrieving, modifying, and deleting individual records in a RecordStore, and converting RecordStore record data to and from byte arrays, and that reflects performance implications.


Is the getBytes() method of the String class considered to be an efficient way of placing text in a RecordStore? or should we use some other method involving ByteStreams?
What about new String( byte[] ) for getting Records out??

Thanks in advance for any advice,
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually that is what I use to read and write records to my RecordStore. I would think that just the act of opening up the Streams would take time.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic