Instead of creating a couple of extra Timestamp objects, move this as the first line in your if statement and just return true, like this:

            if(divBy > 1) {
                return true; // As in this case, we've already got the correct value in ptr
            }

Also, another good optimization would be to check the last four bytes being non zero without creating a Timestamp object. You could do this like this:

    int nanos = PDataType.INTEGER.getCodec().decodeInt(ptr.getBuffer(), ptr.getOffset()+PDataType.LONG.getMaxLength());