mirrored from https://www.bouncycastle.org/repositories/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor reorg of test classes - relates to github #1634
- Loading branch information
Showing
4 changed files
with
46 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
pg/src/test/java/org/bouncycastle/bcpg/test/PacketDumpUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.bouncycastle.bcpg.test; | ||
|
||
import java.io.IOException; | ||
|
||
import org.bouncycastle.bcpg.ContainedPacket; | ||
import org.bouncycastle.test.DumpUtil; | ||
|
||
public class PacketDumpUtil | ||
{ | ||
/** | ||
* Return a formatted hex dump of the packet encoding of the given packet. | ||
* @param packet packet | ||
* @return formatted hex dump | ||
* @throws IOException if an exception happens during packet encoding | ||
*/ | ||
public static String hexdump(ContainedPacket packet) | ||
throws IOException | ||
{ | ||
return DumpUtil.hexdump(packet.getEncoded()); | ||
} | ||
|
||
/** | ||
* Return a formatted hex dump of the packet encoding of the given packet. | ||
* If startIndent is non-zero, the hex dump is shifted right by the startIndent octets. | ||
* @param startIndent shift the encodings octet stream by a number of bytes | ||
* @param packet packet | ||
* @return formatted hex dump | ||
* @throws IOException if an exception happens during packet encoding | ||
*/ | ||
public static String hexdump(int startIndent, ContainedPacket packet) | ||
throws IOException | ||
{ | ||
return DumpUtil.hexdump(startIndent, packet.getEncoded()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters