public byte[] writeByteArray(){
  logger.finer("Writing PairTextEncodedStringNullTerminated");
  int localSize=0;
  ByteArrayOutputStream buffer=new ByteArrayOutputStream();
  try {
    for (    Pair pair : ((ValuePairs)value).mapping) {
{
        TextEncodedStringNullTerminated next=new TextEncodedStringNullTerminated(identifier,frameBody,pair.getKey());
        buffer.write(next.writeByteArray());
        localSize+=next.getSize();
      }
{
        TextEncodedStringNullTerminated next=new TextEncodedStringNullTerminated(identifier,frameBody,pair.getValue());
        buffer.write(next.writeByteArray());
        localSize+=next.getSize();
      }
    }
  }
 catch (  IOException ioe) {
    logger.log(Level.SEVERE,"IOException in MultipleTextEncodedStringNullTerminated when writing byte array",ioe);
    throw new RuntimeException(ioe);
  }
  size=localSize;
  logger.finer("Written PairTextEncodedStringNullTerminated");
  return buffer.toByteArray();
}

public byte [ ] writeByteArray ( ) { logger . finer ( "Writing PairTextEncodedStringNullTerminated" ) ; int localSize = 0 ; ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; try { for ( Pair pair : ( ( ValuePairs ) value ) . mapping ) { { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated ( identifier , frameBody , pair . getKey ( ) ) ; buffer . write ( next . writeByteArray ( ) ) ; localSize += next . getSize ( ) ; } { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated ( identifier , frameBody , pair . getValue ( ) ) ; buffer . write ( next . writeByteArray ( ) ) ; localSize += next . getSize ( ) ; } } } catch ( IOException ioe ) { logger . log ( Level . SEVERE , "IOException in MultipleTextEncodedStringNullTerminated when writing byte array" , ioe ) ; throw new RuntimeException ( ioe ) ; } size = localSize ; logger . finer ( "Written PairTextEncodedStringNullTerminated" ) ; return buffer . toByteArray ( ) ; }
for every string write to bytebuffer
