Ejemplo n.º 1
0
 /**
  * Append a binary 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 appendBinaryBitmap(final Bitmap bitmap, final DataOutputStream output)
     throws IOException {
   output.write(bitmap.asBinary(Bitmap.Id.PRIMARY));
   if (bitmap.isBitmapPresent(Bitmap.Id.SECONDARY)) {
     output.write(bitmap.asBinary(Bitmap.Id.SECONDARY));
     if (bitmap.isBitmapPresent(Bitmap.Id.TERTIARY)) {
       output.write(bitmap.asBinary(Bitmap.Id.TERTIARY));
     }
   }
 }
Ejemplo n.º 2
0
 /**
  * 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);
     }
   }
 }