A compact pellet injector has been built/tested at Oak Ridge National Laboratory (ORNL) for the TJ-II stellarator. The design is an upgraded version of that used for the ORNL injector installed on the Madison Symmetric Torus (MST). It is a four-barrel system equipped with a cryogenic refrigerator for in situ hydrogen pellet formation, a propellant valve system for pellet acceleration (speeds ~1000 m/s), pellet diagnostics, and an injection line. On TJ-II, it will be used as an active diagnostic and for fueling. To accommodate the plasma experiments planned for TJ-II, pellet sizes significantly smaller than those used for the MST application are required. The system has been initially equipped with four pellet sizes, with the gun barrel bores ranging between 0.4 and 1.0 mm. The most challenging technical issue is achieving reliable operation with the smallest pellet size. The system is described, highlighting the new features added since the original MST injector was constructed. Results from laboratory testing are presented and discussed, including the range of pellet sizes and speeds that will be available for initial experiments on TJ-II and the expected reliability of delivering intact pellets to the plasmas.