new SideBandOutputStream(-1, MAX_BUF, rawOut); | new SideBandOutputStream(-1, MAX_BUF, rawOut); | ||||
fail("Accepted -1 channel number"); | fail("Accepted -1 channel number"); | ||||
} catch (IllegalArgumentException e) { | } catch (IllegalArgumentException e) { | ||||
assertEquals("channel -1 must be in range [0, 255]", e.getMessage()); | |||||
assertEquals("channel -1 must be in range [1, 255]", e.getMessage()); | |||||
} | } | ||||
try { | try { | ||||
new SideBandOutputStream(0, MAX_BUF, rawOut); | new SideBandOutputStream(0, MAX_BUF, rawOut); | ||||
fail("Accepted 0 channel number"); | fail("Accepted 0 channel number"); | ||||
} catch (IllegalArgumentException e) { | } catch (IllegalArgumentException e) { | ||||
assertEquals("channel 0 must be in range [0, 255]", e.getMessage()); | |||||
assertEquals("channel 0 must be in range [1, 255]", e.getMessage()); | |||||
} | } | ||||
try { | try { | ||||
new SideBandOutputStream(256, MAX_BUF, rawOut); | new SideBandOutputStream(256, MAX_BUF, rawOut); | ||||
fail("Accepted 256 channel number"); | fail("Accepted 256 channel number"); | ||||
} catch (IllegalArgumentException e) { | } catch (IllegalArgumentException e) { | ||||
assertEquals("channel 256 must be in range [0, 255]", e | |||||
assertEquals("channel 256 must be in range [1, 255]", e | |||||
.getMessage()); | .getMessage()); | ||||
} | } | ||||
} | } |
commitDoesNotHaveGivenParent=The commit ''{0}'' does not have a parent number {1}. | commitDoesNotHaveGivenParent=The commit ''{0}'' does not have a parent number {1}. | ||||
cantFindObjectInReversePackIndexForTheSpecifiedOffset=Can''t find object in (reverse) pack index for the specified offset {0} | cantFindObjectInReversePackIndexForTheSpecifiedOffset=Can''t find object in (reverse) pack index for the specified offset {0} | ||||
cantPassMeATree=Can't pass me a tree! | cantPassMeATree=Can't pass me a tree! | ||||
channelMustBeInRange0_255=channel {0} must be in range [0, 255] | |||||
channelMustBeInRange1_255=channel {0} must be in range [1, 255] | |||||
characterClassIsNotSupported=The character class {0} is not supported. | characterClassIsNotSupported=The character class {0} is not supported. | ||||
checkoutConflictWithFile=Checkout conflict with file: {0} | checkoutConflictWithFile=Checkout conflict with file: {0} | ||||
checkoutConflictWithFiles=Checkout conflict with files: {0} | checkoutConflictWithFiles=Checkout conflict with files: {0} |
/***/ public String commitDoesNotHaveGivenParent; | /***/ public String commitDoesNotHaveGivenParent; | ||||
/***/ public String cantFindObjectInReversePackIndexForTheSpecifiedOffset; | /***/ public String cantFindObjectInReversePackIndexForTheSpecifiedOffset; | ||||
/***/ public String cantPassMeATree; | /***/ public String cantPassMeATree; | ||||
/***/ public String channelMustBeInRange0_255; | |||||
/***/ public String channelMustBeInRange1_255; | |||||
/***/ public String characterClassIsNotSupported; | /***/ public String characterClassIsNotSupported; | ||||
/***/ public String checkoutConflictWithFile; | /***/ public String checkoutConflictWithFile; | ||||
/***/ public String checkoutConflictWithFiles; | /***/ public String checkoutConflictWithFiles; |
* @param chan | * @param chan | ||||
* channel number to prefix all packets with, so the remote side | * channel number to prefix all packets with, so the remote side | ||||
* can demultiplex the stream and get back the original data. | * can demultiplex the stream and get back the original data. | ||||
* Must be in the range [0, 255]. | |||||
* Must be in the range [1, 255]. | |||||
* @param sz | * @param sz | ||||
* maximum size of a data packet within the stream. The remote | * maximum size of a data packet within the stream. The remote | ||||
* side needs to agree to the packet size to prevent buffer | * side needs to agree to the packet size to prevent buffer | ||||
public SideBandOutputStream(final int chan, final int sz, final OutputStream os) { | public SideBandOutputStream(final int chan, final int sz, final OutputStream os) { | ||||
if (chan <= 0 || chan > 255) | if (chan <= 0 || chan > 255) | ||||
throw new IllegalArgumentException(MessageFormat.format( | throw new IllegalArgumentException(MessageFormat.format( | ||||
JGitText.get().channelMustBeInRange0_255, | |||||
JGitText.get().channelMustBeInRange1_255, | |||||
Integer.valueOf(chan))); | Integer.valueOf(chan))); | ||||
if (sz <= HDR_SIZE) | if (sz <= HDR_SIZE) | ||||
throw new IllegalArgumentException(MessageFormat.format( | throw new IllegalArgumentException(MessageFormat.format( |