Hi,

I have written binary files to a SequenceFile, seemeingly successfully, but
when I read them back with the code below, after a first few reads I get the
same number of bytes for the different files. What could go wrong?

Thank you,
Mark

          reader = new SequenceFile.Reader(fs, path, conf);
            Writable key = (Writable)
ReflectionUtils.newInstance(reader.getKeyClass(), conf);
            Writable value = (Writable)
ReflectionUtils.newInstance(reader.getValueClass(), conf);
            long position = reader.getPosition();
            while (reader.next(key, value)) {
                String syncSeen = reader.syncSeen() ? "*" : "";
                byte [] fileBytes = ((BytesWritable) value).getBytes();
                System.out.printf("[%s%s]\t%s\t%s\n", position, syncSeen,
key, fileBytes.length);
                position = reader.getPosition(); // beginning of next record
            }

Reply via email to