public static void writeSwappedLong(OutputStream output,long value) throws IOException {
  output.write((byte)((value >> 0) & 0xff));
  output.write((byte)((value >> 8) & 0xff));
  output.write((byte)((value >> 16) & 0xff));
  output.write((byte)((value >> 24) & 0xff));
  output.write((byte)((value >> 32) & 0xff));
  output.write((byte)((value >> 40) & 0xff));
  output.write((byte)((value >> 48) & 0xff));
  output.write((byte)((value >> 56) & 0xff));
}

public static void writeSwappedLong ( OutputStream output , long value ) throws IOException { output . write ( ( byte ) ( ( value > > 0 ) & 0xff ) ) ; output . write ( ( byte ) ( ( value > > 8 ) & 0xff ) ) ; output . write ( ( byte ) ( ( value > > 16 ) & 0xff ) ) ; output . write ( ( byte ) ( ( value > > 24 ) & 0xff ) ) ; output . write ( ( byte ) ( ( value > > 32 ) & 0xff ) ) ; output . write ( ( byte ) ( ( value > > 40 ) & 0xff ) ) ; output . write ( ( byte ) ( ( value > > 48 ) & 0xff ) ) ; output . write ( ( byte ) ( ( value > > 56 ) & 0xff ) ) ; }
writes a " long " value to an outputstream . the value is converted to the opposed endian system while writing .
