Skip to content

Instantly share code, notes, and snippets.

@josefbetancourt
josefbetancourt / HexDump.groovy
Last active September 13, 2016 15:25
Groovy Hex Dump
package com.octodecillion.util
import static java.lang.Character.*
/**
* Simple ASCII hex dump of file.
* <p>
* Example output:<br>
* <pre>
* OFFSET 0 1 2 3 4 5 6 7 8 9 a b c d e f | ASCII
package com.octodecillion.util;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@josefbetancourt
josefbetancourt / FindFile.groovy
Created July 9, 2012 11:52
Use Groovy to find path of a file in a directory tree
import groovy.transform.TypeChecked
/**
* search file according to its name in directory and subdirectories
*/
@TypeChecked
class FileFind {
String basePath; // for unit testing