/** Stores an array to a given data output. * * @param array an array whose elements will be written to {@code dataOutput}. * @param dataOutput a data output. */ public static void storeBytes(final byte array[], final DataOutput dataOutput) throws IOException { write(dataOutput, array, 0, array.length); } /** Stores an array fragment to a file given by a {@link File} object.
/** Stores a big-array fragment to a given output stream. * * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[][],long,long,DataOutput)} * as it uses {@link OutputStream}'s bulk-read methods. * * @param array a big array whose elements will be written to {@code outputStream}. * @param offset the index of the first element of {@code array} to be written. * @param length the number of elements of {@code array} to be written. * @param outputStream an output stream. */ public static void storeBytes(final byte array[][], final long offset, final long length, final OutputStream outputStream) throws IOException { write(outputStream, array, offset, length); } /** Stores a big array to a given output stream.
/** Stores an array to a given output stream. * * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[],DataOutput)} * as it uses {@link OutputStream}'s bulk-read methods. * * @param array an array whose elements will be written to {@code outputStream}. * @param outputStream an output stream. */ public static void storeBytes(final byte array[], final OutputStream outputStream) throws IOException { write(outputStream, array, 0, array.length); } private static long read(final InputStream is, final byte a[][], final long offset, final long length) throws IOException {
/** Stores an array fragment to a given output stream. * * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[],int,int,DataOutput)} * as it uses {@link OutputStream}'s bulk-read methods. * * @param array an array whose elements will be written to {@code outputStream}. * @param offset the index of the first element of {@code array} to be written. * @param length the number of elements of {@code array} to be written. * @param outputStream an output stream. */ public static void storeBytes(final byte array[], final int offset, final int length, final OutputStream outputStream) throws IOException { write(outputStream, array, offset, length); } /** Stores an array to a given output stream.
/** Stores an array fragment to a given data output. * * @param array an array whose elements will be written to {@code dataOutput}. * @param offset the index of the first element of {@code array} to be written. * @param length the number of elements of {@code array} to be written. * @param dataOutput a data output. */ public static void storeBytes(final byte array[][], final long offset, final long length, final DataOutput dataOutput) throws IOException { it.unimi.dsi.fastutil.bytes.ByteBigArrays.ensureOffsetLength(array, offset, length); write(dataOutput, array, offset, length); } /** Stores a big array to a given data output.
/** Stores a big array to a given output stream. * * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[][],DataOutput)} * as it uses {@link OutputStream}'s bulk-read methods. * * @param array a big array whose elements will be written to {@code outputStream}. * @param outputStream an output stream. */ public static void storeBytes(final byte array[][], final OutputStream outputStream) throws IOException { write(outputStream, array, 0, ByteBigArrays.length(array)); } /** Loads elements from a given data input, storing them in a given array fragment.
/** Stores an array fragment to a given data output. * * @param array an array whose elements will be written to {@code dataOutput}. * @param offset the index of the first element of {@code array} to be written. * @param length the number of elements of {@code array} to be written. * @param dataOutput a data output. */ public static void storeBytes(final byte array[], final int offset, final int length, final DataOutput dataOutput) throws IOException { it.unimi.dsi.fastutil.bytes.ByteArrays.ensureOffsetLength(array, offset, length); write(dataOutput, array, offset, length); } /** Stores an array to a given data output.
/** Stores an array to a file given by a {@link File} object. * * @param array an array whose elements will be written to {@code filename}. * @param file a file. */ public static void storeBytes(final byte array[], final File file) throws IOException { final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); write(os, array, 0, array.length); os.close(); } /** Stores an array to a file given by a pathname.
/** Stores a big array to a given data output. * * @param array a big array whose elements will be written to {@code dataOutput}. * @param dataOutput a data output. */ public static void storeBytes(final byte array[][], final DataOutput dataOutput) throws IOException { write(dataOutput, array, 0, ByteBigArrays.length(array)); } /** Stores a big-array fragment to a file given by a {@link File} object.
/** Stores an array to a file given by a {@link File} object. * * @param array an array whose elements will be written to {@code filename}. * @param file a file. */ public static void storeBytes(final byte array[][], final File file) throws IOException { final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); write(os, array, 0, ByteBigArrays.length(array)); os.close(); } /** Stores a big array to a file given by a pathname.
/** Stores an array fragment to a file given by a {@link File} object. * * @param array an array whose elements will be written to {@code filename}. * @param offset the index of the first element of {@code array} to be written. * @param length the number of elements of {@code array} to be written. * @param file a file. */ public static void storeBytes(final byte array[], final int offset, final int length, final File file) throws IOException { it.unimi.dsi.fastutil.bytes.ByteArrays.ensureOffsetLength(array, offset, length); final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); write(os, array, offset, length); os.close(); } /** Stores an array fragment to a file given by a pathname.
/** Stores a big-array fragment to a file given by a {@link File} object. * * @param array a big array whose elements will be written to {@code filename}. * @param offset the index of the first element of {@code array} to be written. * @param length the number of elements of {@code array} to be written. * @param file a file. */ public static void storeBytes(final byte array[][], final long offset, final long length, final File file) throws IOException { it.unimi.dsi.fastutil.bytes.ByteBigArrays.ensureOffsetLength(array, offset, length); final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); write(os, array, offset, length); os.close(); } /** Stores a big-array fragment to a file given by a pathname.