diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/operation/ChargementBrut.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/operation/ChargementBrut.java index c6bcc5e50..64fea20b2 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/operation/ChargementBrut.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/operation/ChargementBrut.java @@ -51,7 +51,8 @@ private String requeteFichierBrutalement(String idSource, BufferedReader br, int int idLigne = nbBoucle * LIMIT_CHARGEMENT_BRUTAL_NB_LIGNE; String line; try { - line = br.readLine().substring(0, LIMIT_CHARGEMENT_BRUTAL_NB_CHAR); + line = br.readLine(); + line = line.substring(0, Math.min(line.length(), LIMIT_CHARGEMENT_BRUTAL_NB_CHAR)); } catch (IOException e) { throw new ArcException(e, ArcExceptionMessage.FILE_READ_FAILED, idSource); }