If we think iterator.length will be < 4 often we might want to look into optimizing it as we will both allocate the array and throw the exception before we know if it was too small. Also note that ByteString.apply will also allocate its own internal byte array, so if this is performance-sensitive (tracing normally is right?) we probably want to avoid exception-throwing and allocations first.