private static void writeExtraCodes(int charOffset,byte[] bytes,byte extraCodeModifier,ExtraCodesStream extraCodes) throws IOException {
  int numChars=extraCodes.getNumChars();
  if (numChars < charOffset) {
    int fillChars=charOffset - numChars;
    extraCodes.writeFill(fillChars,INTERNATIONAL_EXTRA_PLACEHOLDER);
    extraCodes.incrementNumChars(fillChars);
  }
  if (bytes != null) {
    extraCodes.write(bytes);
    extraCodes.incrementNumChars(1);
  }
 else {
    int lastIdx=extraCodes.getLength() - 1;
    if (lastIdx >= 0) {
      byte lastByte=extraCodes.get(lastIdx);
      lastByte+=extraCodeModifier;
      extraCodes.set(lastIdx,lastByte);
    }
 else {
      extraCodes.write(extraCodeModifier);
      extraCodes.setUnprintablePrefixLen(1);
    }
  }
}

private static void writeExtraCodes ( int charOffset , byte [ ] bytes , byte extraCodeModifier , ExtraCodesStream extraCodes ) throws IOException { int numChars = extraCodes . getNumChars ( ) ; if ( numChars < charOffset ) { int fillChars = charOffset - numChars ; extraCodes . writeFill ( fillChars , INTERNATIONAL_EXTRA_PLACEHOLDER ) ; extraCodes . incrementNumChars ( fillChars ) ; } if ( bytes != null ) { extraCodes . write ( bytes ) ; extraCodes . incrementNumChars ( 1 ) ; } else { int lastIdx = extraCodes . getLength ( ) - 1 ; if ( lastIdx >= 0 ) { byte lastByte = extraCodes . get ( lastIdx ) ; lastByte += extraCodeModifier ; extraCodes . set ( lastIdx , lastByte ) ; } else { extraCodes . write ( extraCodeModifier ) ; extraCodes . setUnprintablePrefixLen ( 1 ) ; } } }
encodes the given extra code info in the given stream .
