/** * Append a hex (character encoded) bitmap to the output stream * * @param bitmap to be appended * @param output stream to append data to * @throws IOException if the data could not be written tot he output stream */ private void appendHexBitmap(final Bitmap bitmap, final DataOutputStream output) throws IOException { final byte[] bitmap1 = charCodec.getBytes(bitmap.asHex(Bitmap.Id.PRIMARY)); output.write(bitmap1); if (bitmap.isBitmapPresent(Bitmap.Id.SECONDARY)) { final byte[] bitmap2 = charCodec.getBytes(bitmap.asHex(Bitmap.Id.SECONDARY)); output.write(bitmap2); if (bitmap.isBitmapPresent(Bitmap.Id.TERTIARY)) { final byte[] bitmap3 = charCodec.getBytes(bitmap.asHex(Bitmap.Id.TERTIARY)); output.write(bitmap3); } } }
/** * Write the supplied header string to the output stream * * @param header * @param output stream to append data to * @throws IOException if the data could not be written tot he output stream */ public void appendHeader(final String header, final DataOutputStream output) throws IOException { output.write(charCodec.getBytes(header)); }
protected void write(final String data, final DataOutputStream output) throws IOException { write(charCodec.getBytes(data), output); }