Class FileLinesByteArrayCollection

  • All Implemented Interfaces:
    it.unimi.dsi.fastutil.Size64, java.lang.Iterable<byte[]>, java.util.Collection<byte[]>

    @Deprecated
    public class FileLinesByteArrayCollection
    extends java.util.AbstractCollection<byte[]>
    implements it.unimi.dsi.fastutil.Size64
    Deprecated.
    Please use FileLinesByteArrayIterable instead; the zipped option of this class can be simulated by passing a GZIPInputStream as decompressor.
    A wrapper exhibiting the lines of a file as a Collection of byte arrays.

    An instance of this class allows to access the lines of a file as a Collection of byte arrays. Reading is performed using FastBufferedInputStream.readLine(byte[], EnumSet), and follows the rules defined therein. No decoding is performed.

    Using direct access is strongly discouraged (it will require a full scan of the file), but the iterator() can be fruitfully used to scan the file, and can be called any number of times, as it opens an independent input stream at each call. For the same reason, the returned iterator type (FileLinesCollection.FileLinesIterator) is Closeable, and should be closed after usage.

    Using a suitable constructor, it is possible to specify that the file is compressed in gzip format (in this case, it will be opened using a GZIPInputStream).

    Note that the first call to size64() will require a full file scan.

    Since:
    2.2.8
    Author:
    Sebastiano Vigna
    • Constructor Summary

      Constructors 
      Constructor Description
      FileLinesByteArrayCollection​(java.lang.CharSequence filename)
      Deprecated.
      Creates a byte-array file-lines collection for the specified filename, using both CR and LF as line terminators.
      FileLinesByteArrayCollection​(java.lang.CharSequence filename, boolean zipped)
      Deprecated.
      Creates a byte-array file-lines collection for the specified filename, optionally assuming that the file is compressed using gzip format, using both CR and LF as line terminators.
      FileLinesByteArrayCollection​(java.lang.CharSequence filename, boolean zipped, java.util.EnumSet<it.unimi.dsi.fastutil.io.FastBufferedInputStream.LineTerminator> terminators)
      Deprecated.
      Creates a byte-array file-lines collection for the specified filename, optionally assuming that the file is compressed using gzip format, using the specified line terminators.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      it.unimi.dsi.fastutil.objects.ObjectBigList<byte[]> allLines()
      Deprecated.
      Returns all lines of the file wrapped by this file-lines collection.
      FileLinesByteArrayCollection.FileLinesIterator iterator()
      Deprecated.
       
      int size()
      Deprecated.
      Please use size64() instead.
      long size64()
      Deprecated.
       
      java.lang.Object[] toArray()
      Deprecated.
      <T> T[] toArray​(T[] a)
      Deprecated.
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.util.AbstractCollection

        add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • FileLinesByteArrayCollection

        public FileLinesByteArrayCollection​(java.lang.CharSequence filename)
        Deprecated.
        Creates a byte-array file-lines collection for the specified filename, using both CR and LF as line terminators.
        Parameters:
        filename - a filename.
      • FileLinesByteArrayCollection

        public FileLinesByteArrayCollection​(java.lang.CharSequence filename,
                                            boolean zipped)
        Deprecated.
        Creates a byte-array file-lines collection for the specified filename, optionally assuming that the file is compressed using gzip format, using both CR and LF as line terminators.
        Parameters:
        filename - a filename.
        zipped - whether filename is zipped.
      • FileLinesByteArrayCollection

        public FileLinesByteArrayCollection​(java.lang.CharSequence filename,
                                            boolean zipped,
                                            java.util.EnumSet<it.unimi.dsi.fastutil.io.FastBufferedInputStream.LineTerminator> terminators)
        Deprecated.
        Creates a byte-array file-lines collection for the specified filename, optionally assuming that the file is compressed using gzip format, using the specified line terminators.
        Parameters:
        filename - a filename.
        zipped - whether filename is zipped.
        terminators - line terminators for the underlying FastBufferedInputStream.
    • Method Detail

      • iterator

        public FileLinesByteArrayCollection.FileLinesIterator iterator()
        Deprecated.
        Specified by:
        iterator in interface java.util.Collection<byte[]>
        Specified by:
        iterator in interface java.lang.Iterable<byte[]>
        Specified by:
        iterator in class java.util.AbstractCollection<byte[]>
      • size

        @Deprecated
        public int size()
        Deprecated.
        Please use size64() instead.
        Specified by:
        size in interface java.util.Collection<byte[]>
        Specified by:
        size in interface it.unimi.dsi.fastutil.Size64
        Specified by:
        size in class java.util.AbstractCollection<byte[]>
      • size64

        public long size64()
        Deprecated.
        Specified by:
        size64 in interface it.unimi.dsi.fastutil.Size64
      • allLines

        public it.unimi.dsi.fastutil.objects.ObjectBigList<byte[]> allLines()
        Deprecated.
        Returns all lines of the file wrapped by this file-lines collection.
        Returns:
        all lines of the file wrapped by this file-lines collection.
      • toArray

        @Deprecated
        public java.lang.Object[] toArray()
        Deprecated.
        Specified by:
        toArray in interface java.util.Collection<byte[]>
        Overrides:
        toArray in class java.util.AbstractCollection<byte[]>
      • toArray

        @Deprecated
        public <T> T[] toArray​(T[] a)
        Deprecated.
        Specified by:
        toArray in interface java.util.Collection<byte[]>
        Overrides:
        toArray in class java.util.AbstractCollection<byte[]>
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.util.AbstractCollection<byte[]>