protected void writeTextureMask(ObjectOutputStream oos,TexturePaint tMask) throws IOException {
  boolean writeMask=(tMask instanceof Serializable);
  if (writeMask) {
    oos.writeBoolean(true);
    oos.writeObject((Serializable)tMask);
  }
 else {
    oos.writeBoolean(false);
  }
}

protected void writeTextureMask ( ObjectOutputStream oos , TexturePaint tMask ) throws IOException { boolean writeMask = ( tMask instanceof Serializable ) ; if ( writeMask ) { oos . writeBoolean ( true ) ; oos . writeObject ( ( Serializable ) tMask ) ; } else { oos . writeBoolean ( false ) ; } }
will only write texturepaint objects that are serializable .
