| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2014-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | */ |
| | | public int nextIntUTF8() throws DataFormatException |
| | | { |
| | | return Integer.valueOf(nextString()); |
| | | final String s = nextString(); |
| | | try |
| | | { |
| | | return Integer.parseInt(s); |
| | | } |
| | | catch (NumberFormatException e) |
| | | { |
| | | throw new DataFormatException("Expected an int but read \"" + s + "\""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public long nextLongUTF8() throws DataFormatException |
| | | { |
| | | return Long.valueOf(nextString()); |
| | | final String s = nextString(); |
| | | try |
| | | { |
| | | return Long.parseLong(s); |
| | | } |
| | | catch (NumberFormatException e) |
| | | { |
| | | throw new DataFormatException("Expected a long but read \"" + s + "\""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | return CSN.valueOf(nextString()); |
| | | } |
| | | catch (IndexOutOfBoundsException e) |
| | | catch (LocalizedIllegalArgumentException | IndexOutOfBoundsException e) |
| | | { |
| | | throw new DataFormatException(e.getMessage()); |
| | | } |