class BsUtil {

    static void writeFormattedLong(final long value, OutputStream outputStream)
      throws IOException {
        long y = value;
        if (y < 0) {
            y = (-y) | NEGATIVE_MASK;
        }

        for (int i = 0; i < 8; ++i) {
            outputStream.write((byte) (y & 0xff));
            y >>>= 8;
        }
    }

}