public final void writeModeAndDesc(final boolean isReverse, final byte[] sa) {
        final int len = sa == null ? 0 : sa.length;
        final int sizecode = len << 1 | (isReverse ? 1 : 0);
        writeVarLengthUnsigned(sizecode);
        if (len > 0) {
            write(sa, 0, len);
        }
    }
fast data-writing to a byte-array

@author ab
main/src/main/java/cgeo/geocaching/brouter/util/ByteDataWriter.java