Duh! Was storing date as a double in the bytearray and reading it as a long. No wonder it was screwed up. Making a new simple activity to read and write directly for testing.