private static int writePackedInt(final OutputStream out, final int value) throws IOException {
    final byte[] packedInt = JBBPUtils.packInt(value);
    out.write(packedInt);
    return packedInt.length;
  }
private static int writePackedInt ( final OutputStream out , final int value ) throws IOException { final byte [ ] packedInt = JBBPUtils . packInt ( value ) ; out . write ( packedInt ) ; return packedInt . length ; }
Write an integer value in packed form into an output stream.

@param out   the output stream to be used to write the value into
@param value the value to be written into the output stream
@return the length of packed data in bytes
@throws IOException it will be thrown for any IO problems